I'm trying to prevent players from being afk killed, or ff killed. I know this can be a problem for other games, and I want it to be fixed in my game if it can be done. I'm not sure how I would start this, but i think it will be something like this.
sword = ClassicSword player = game.Players.Localplayer ff = Instance.new("ForceField") ff.Parent = player
And, that's all my knowledge on this. Help?
Utilize the Equipped event of tools. Make a local script in your starter pack that says something like this:
tool = game.Players.LocalPlayer.Backpack["YOUR_TOOL_NAME_HERE"] ff = Instance.new("ForceField", game.Players.LocalPlayer.Character) tool.Equipped:connect(function() ff:remove() end)
I hope this works for you!
If a person doesn't have a tool equipped, then the parent of that tool is the player's backpack. (Players)
First of all, we don't know what the sword's name is. A script like this would probably require the name of the sword. Please edit your answer and make a variable for the sword.