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

Why doesn't my RemoteEvent fire on a clicked function?

Asked by 3 years ago

Hey, I'm kind of new to this and I tried everything I could but I can't make my remove event fire on a clicker function here's the script. When a player clicks on a part they teleport, that part is fine but the only thing that isn't working is the RemoteEvent.

function onClicked(plr)
game.ReplicatedStorage.FadeScreenDoor:FireServer()
wait(1.20)
plr.Character.HumanoidRootPart.CFrame = CFrame.new(6.504, -35.341, 111.535)
end
script.parent.ClickDetector.MouseClick:connect(onClicked)
0
is this in a local script? BulletproofVast 1033 — 3y
0
you don't need a remote for this, you could just do it all in a regular script. BulletproofVast 1033 — 3y
0
should it be a local script? andioopmyson12 23 — 3y
0
if you use fireserver, it needs to be a local script but i dont think they run in workspace. BulletproofVast 1033 — 3y
0
Local Scripts only run in Instaces that are for the client, like StarterPlayer, PlayerGui, Backpack, PlayerScripts, etc. Finty_james 269 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

you could make FadeScreenDoor a function and do something like this can put all in a server script.

function onClicked(plr)
    FadeScreenDoor() -- if you want only the client to see it, do :FireClient(plr)
    wait(1.20)
    plr.Character.HumanoidRootPart.CFrame = CFrame.new(6.504, -35.341, 111.535)
end

script.Parent.ClickDetector.MouseClick:Connect(onClicked) -- parent should be Parent (capitalized)

function FadeScreenDoor()
    -- whatever this does
end)
Ad

Answer this question