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)
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.
1 | script.Parent.Touched:Connect( function () |
2 | print ( "ok" ) -- replace this with the code you want to execute when you touch it |
3 | end ) |
just incase you need explorer help somebody could probs make this better but this is the way i would do it