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

[SOLVED] For some reason remote events fire by them self can anyone help?

Ok so im really new to lua but im currently making a game and i have a button with clickdetetctor and all of that so i have a remote event i put a script inside the remote events when i start the game the remote events fires by itself can anyone help me?

(it destroys a door when you push the button)

7 comments

0

Can you post your script?

0

Ok wait

0

local clickdetector = game.Workspace.Button.ClickDetector clickdetector.MouseClick:Connect(function() game.Workspace.DisableDoor:FireServer() end) – remote event inside Workspace game.Workspace.Door:Destroy() – here if i missed anything out tell me

0

Also sorry the code looks messy sorry for that

0

game.Workspace.Door:Destroy() is not a part of the function. Currently, it is set to fire immediately after the connection. Move the "end)" part to after the "Destroy()" to put it in your function.

0

the game.Workspace.Door:Destroy() is inside a script in a remote event i put it in replicated storage it doesnt fire automatically but now i cant fire it

0

"Scripts and LocalScripts will not run when they are parented to ReplicatedStorage..." Move it into the script in Workspace. Also you don't need a remote event if you are destroying it server side. If you are destroying it locally, it won't work in RS. https://developer.roblox.com/api-reference/class/ReplicatedStorage

1 answer

✓ Accepted answer

Why use RemoteEvents? The RemoteEvent make a connection with the clients and the server. Why use RemoteEvent? Recently ROBLOX make a update to against the hackers. In this update ROBLOX have insert the "FilteringEnabled". This fonction send information of the server to the client, but block the client informations to the server.

How to use it? FireServer --> send informations client to server FireClient --> send informations to specific client FireAllClients -- > send informations to all clients of the server

Now know than Script (ServerScript) is for the server and LocalScript (ClientScript) for the client. And not inverse because that not work.

For your script, you don't have need a RemoteEvent

Script/ServerScript

script.Parent.MouseClick:Connect(function(player) -- Who have clicked?
    script.Parent.Parent:Destroy() -- What do you destroy?
end)

Solved your question? Put in title [SOLVED] or accept a answer.

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