i’m trying to make a part fire a remote event when touched by a part named “tax”, but nothing happens. no errors, just… nothing. here is the local script:
local remote = game:GetService("ReplicatedStorage").Remotes.GiveCurrency
script.Parent.Touched:Connect(function(hit)
if hit.Name == "tax" then
print("part touched")
remote:FireServer()
hit:Destroy()
end
end)
if you know what is causing this, or need more information, please reply!
If this is located inside of a part, this script won’t execute. LocalScripts can only run in client services (like StarterGui or StarterPlayerScripts, for example) With the exception of the player’s own character model.
You could put your script in StarterCharacterScripts, and then define a reference to the part you want the player to be able to touch.
comment above is right
but heres an unrelated question
I see that you’re calling a remote from the client to the server
do you have any checks to ensure that exploiters cannot manipulate that remote to give themselves money?