I am currently making an obby-themed minigame-based game, and one of the minigames is a Wipeout-themed spinner. If the spinner is touched by a player, it is meant to kill the player.
However, as seen below, you can see that often, the spinner prematurely kills the player.
I have a .Touched event attached to each player’s humanoid, that detects when the spinner is touched, and it then kills the player, as seen in this code:
hum.Touched:Connect(function(touchingPart: BasePart, humanoidPart: BasePart)
if touchingPart.Name == "kill" then
hum.Health = 0
end
end)
Yeah Roblox has a serious issue with server refresh rate. I hope they bring an option to change it though, but that would bring new issues. The problem with doing it on a local script is it makes it very hackable.
You can’t use a normal local script. you have to use a server script under the part, then change the run context to client and put the touched code there
If the spinner uses a server script to change its orientation then just delete that and replace it with a hinge constraint motor. Works much better for me.
What other games do, is they have the spinner created on the client, and the touched code running in a local script. However, not all clients will see the spinner at the same location at the same time.
What you are suggesting here was suggested by @wastbo prior, and it offered marginal improvements, but did not solve the issue completely.
The solution was found when I ended up making a script where:
The spinner is on the server. All clients see the spinner at the same time, unless there is some horrific lag. The spinner’s CanTouch property is set to false.
I had an event fire for all clients, where the spinner’s CanTouch property is set to true, on the client.
In the same code in #2, I had a .Touched event created, and it fired a remote. Firing that remote kills the player that fired it.
This isn’t perfect, and it will possibly allow for exploiting, but it really fixed the issue here that I spent the better part of 1-2 hours trying to resolve. Resulted in accurate .Touched detection
No, but changing its CollissionFidelity had no effect on the issue. It seems to be a very big ROBLOX replication issue that @RocketSlither mentioned earlier, unless you have stuff run on the client like @SelDraken suggested