Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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)

5 comments

0

is this in a local script?

0

you don't need a remote for this, you could just do it all in a regular script.

0

should it be a local script?

0

if you use fireserver, it needs to be a local script but i dont think they run in workspace.

0

Local Scripts only run in Instaces that are for the client, like StarterPlayer, PlayerGui, Backpack, PlayerScripts, etc.

1 answer

✓ Accepted answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.