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

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

Asked by 5 years ago
Edited 5 years ago

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)

0
Can you post your script? MRbraveDragon 374 — 5y
0
Ok wait Oskar2266001 3 — 5y
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 Oskar2266001 3 — 5y
0
Also sorry the code looks messy sorry for that Oskar2266001 3 — 5y
View all comments (3 more)
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. Cousin_Potato 129 — 5y
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 Oskar2266001 3 — 5y
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 Cousin_Potato 129 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

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.

Ad

Answer this question