disabled = false
script.Parent.MouseButton1Click:Connect(function()
if disabled == false then
disabled = true
script.Parent.BackgroundColor3 = Color3.new(217, 0, 0)
game.Workspace.Teleport.RemoteFunction:invokeServer()
wait(3)
script.Parent.BackgroundColor3 = Color3.new(0, 154, 0)
disabled = false
end
end)
COMMUNITY QUESTION
Why does it tell me RemoteFunction is not a valid member of Script?
1 answer
local part = game.Workspace.Bridges.Bridge1.Base
script.RemoteFunction.OnServerInvoke = function(player)
local humanoid = player.Character.Humanoid
if humanoid.Parent:FindFirstChild("Torso") then
humanoid.Parent.Torso.Cframe = CFrame.new(part.Position + Vector3.new(0,3,0))
elseif humanoid.Parent:FindFirstChild("UpperTorso") then
humanoid.Parent.UpperTorso.Cframe = CFrame.new(part.Position + Vector3.new(0,3,0))
else print("notroso")
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Can you show a bigger chunk of your script to see if you made a RemoteFunction?
We need the whole script to identify why it doesn't work.
Yeah I posted it now