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

how would I make this RemoteEvent run With a ClickDetector?

Asked by 4 years ago

I made a button script and everything is working I think the event is not firing here is the LocalScript in the serverscriptservice.

1local clickdetector = game.Workspace.pully.MeshPart.ClickDetector
2clickdetector.MouseClick:Connect((function()
3    game.Workspace.RemoteEvent:FireServer()
4end)

Then i have a script inside of an RemoteEvent named RemoteEvent. There is the script (it is in workspace)

01local pully = game.Workspace.pully
02    game.Workspace.RemoteEvent.OnServerEvent:Connect(function()
03 
04 
05 
06    pully.PrimaryPart = pully.primary_part
07 
08 
09 
10 
11    pully:SetPrimaryPartCFrame(Vector3.new(-23.536, 10.517, -23.911))
12    end)

My guess is that I'm not firing the event I asked a question before this about if I can use ClickDetectors in meshes I believe it was taken down but it was answered yes

2 answers

Log in to vote
1
Answered by
MemezyDev 172
4 years ago

rip i posted on the wrong thing but why is there a local script in serverscriptservice also you made an error lol

1local clickdetector = game.Workspace.pully.MeshPart.ClickDetector
2clickdetector.MouseClick:Connect(function() -- you have ((function() when it should only be (function()
3    game.Workspace.RemoteEvent:FireServer()
4end)
0
can you go into community chat so we can talk about this LTRNightmare 66 — 4y
0
- FireServer can only be called from the client LTRNightmare 66 — 4y
0
yea he said that the fireserver is inside the client MemezyDev 172 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

Local scripts only work when placed in A Player’s Backpack, such as a child of a Tool A Player’s character model A Player’s PlayerGui A Player’s PlayerScripts. The ReplicatedFirst service

Answer this question