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.

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

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

local pully = game.Workspace.pully
    game.Workspace.RemoteEvent.OnServerEvent:Connect(function()



    pully.PrimaryPart = pully.primary_part




    pully:SetPrimaryPartCFrame(Vector3.new(-23.536, 10.517, -23.911))
    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

local clickdetector = game.Workspace.pully.MeshPart.ClickDetector
clickdetector.MouseClick:Connect(function() -- you have ((function() when it should only be (function()
    game.Workspace.RemoteEvent:FireServer()
end)
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