Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does it tell me RemoteFunction is not a valid member of Script?

Asked by 5 years ago
Edited 5 years ago
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)
0
Can you show a bigger chunk of your script to see if you made a RemoteFunction? chafava -113 — 5y
0
We need the whole script to identify why it doesn't work. Dalamix 26 — 5y
0
Yeah I posted it now Skydoeskey 108 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
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
Ad

Answer this question