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

how would I make this RemoteEvent run With a ClickDetector?

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

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)

3 comments

0

can you go into community chat so we can talk about this

0
  • FireServer can only be called from the client
0

yea he said that the fireserver is inside the client

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

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