I am making an obby game and added power ups players can buy. One of these is an invincibility powerup which gives the player a forcefield. I used takedamage on all my kill parts because apparently this is the only way to make the forcefield actually work. Here is the script in the kill parts
part.Touched:Connect(function(hit)
local human = hit.Parent:FindFirstChild("Humanoid")
if human ~= nil then
human:TakeDamage(100)
end
end)
I gave the players a forcefield using a server script and everytime they die (like falling off the map) a remote event tells the server to give them a new forcefield which works fine. The issue is that sometimes the forcefield just won’t work. What is annoying me the most is the fact that it will/won’t work for each play session I do in studio. So if I hit play and the forcefield works, every time I reset or walk on a kill part the forcefield WILL work. However if I hit play and the forcefield doesn’t work everytime I walk on a kill part the forcefield WILL NOT work. In the workspace however there is always a forcefield parented to my character. Every single time, this part always works there is always a forcefield. I tried to see if it was just a studio glitch but even when I regularly play the game it is still inconsistent. Are forcefields just bad? Do they just never work consistently?