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

Can RemoteEvents be fired by a Part being touched? If so, why are my scripts not working?

Asked by 4 years ago

I already put a RemoteEvent in ReplicatedStorage.

LocalScript which is inside a Part in Workspace:

script.Parent.Touched:Connect(function() game.ReplicatedStorage.RemoteEvent:FireServer() end)

Script which is inside of ServerScriptService:

game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function() print("ok") end)

0
super strange i put this script into the Part and it doesn't even work : script.Parent.Touched:Connect(function() print("touched") end) ewdoggypoopoo 12 — 4y
0
Local scripts can't fire server events! Casual_Keldeo 4 — 4y
0
Your local script is in a character? PepeElToro41 132 — 4y
0
Localscripts won't run in workspace. They have to be inside playerScripts or a player's backpack. Use a script instead. whenallthepigsfly 541 — 4y
0
LocalScripts don't work in Workspace, and if you chose to use a Normal script, FireServer() can't be fired there, as you're already contacting the server. So, just put a Normal Script inside the part and write the function you want. mixgingengerina10 223 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

you said it was in the local script? you cant detect collision from a local script replace the local script with a normal script the way i would do is just put the code from the remote event into the touched event.

script.Parent.Touched:Connect(function() 
    print("ok") -- replace this with the code you want to execute when you touch it
end)

just incase you need explorer help somebody could probs make this better but this is the way i would do it

Ad

Answer this question