Here's my script;
local Players = game:GetService("Players") local function onPlayerAdded(player) local ability = player:WaitForChild("Status"):WaitForChild("Ability") if ability.Value == "None" then return end if ability.Value == "Magnet" then local Clone = game.ReplicatedStorage:WaitForChild("MagnetPunch"):Clone() Clone.Parent = player.Backpack end end for _,player in pairs(Players:GetPlayers()) do onPlayerAdded(player) end Players.PlayerAdded:connect(onPlayerAdded)
It won't function so I don't know. There were no errors so I'm guessing I placed it in the wrong place. Where should I place it and if there are any errors please tell me.
Scripts will execute their containing code whenever they are inside Workspace or ServerScriptService.> - From the wiki.
However, the problem is not in the placement. The problem is probably that there is no Magnet as value of status... So its just returning false. But if it's not that try printing 2 separate things one at the start of the function and one after the wait line.
It would probably be put in ServerScriptService or Workspace. I would think that it would be able to be put anywhere, though, as long as its in the server and not in the player.