How do I make a player finder script which uses magnitude to add a object value to a folder?
Asked by
5 years ago Edited 5 years ago
My code is this
the name of the script is player finder
01 | local Attacks = require(script.Parent.Attacks) |
02 | game.Players.PlayerAdded:Connect( function (plr) |
04 | plr.CharacterAdded:Connect( function (char) |
05 | local Torso = char:FindFirstChild( "Torso" ) or char:FindFirstChild( "UpperTorso" ) |
06 | local mag = (Torso.Position - script.Parent.UpperTorso.Position) |
09 | if not Attacks:IsPlayerHere(plr.Name) then |
10 | local obj = Instance.new( "ObjectValue" ) |
13 | obj.Parent = script.Parent.Players |
it's supposed to add a value to a folder and the module script has a player checking system and returns true or false
2 | function Attacks:IsPlayerHere(plrinquestion) |
3 | if script.Parent.Players:FindFirstChild(plrinquestion) then |
is the loop not working for the magnitude?