Why Is my forcefield GUI not placing forcefield on the player?
Ello fellow robloxains! I have appear to come Into a problem when making a GUI as the name suggest Its a simple GUI button that makes a forcefield when you press It however It doesn't spawn on the player rather Instead In the middle of the baseplate how can I overcome this problem?
Script:
1 | local plr = game.Players.LocalPlayer |
2 | script.Parent.MouseButton 1 Down:Connect( function () |
3 | local Forcefield = Instance.new( "ForceField" ) |
4 | Forcefield.Parent = game.Workspace |
5 | Forcefield.Position = plr.Character.HumanoidRootPart.Position |