Client to Server
Scripts
Scripts
LocalScript under TextButton
LocalScript under TextButton
local button = script.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")
local function triggerEvent()
remoteEvent:FireServer()
end
button.MouseButton1Click:Connect(triggerEvent)
ServerScriptService
ServerScriptService
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")
local function newPart()
local part = Instance.new('Part')
part.Parent = game.Workspace
end
remoteEvent.OnServerEvent:Connect(newPart)