Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make this forcefield appear only on me, and how do I make it infinite?

Asked by 7 years ago

I wanna troll in my game ;) Here's my script so far:

01local player = game.Players.LocalPlayer
02if player == izanagi456 then
03game.Players.PlayerAdded:Connect(function(p)
04    p.CharacterAdded:Connect(function(c)
05        local ff = Instance.new("ForceField")
06        ff.Visible = false
07        ff.Parent = c
08end
09)
10end
11)
12end

1 answer

Log in to vote
0
Answered by 7 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.

You would just check if the name was yours and then add the ForceField Alot of your code was wrong too. Put this in a normal script inside ServerScriptService.

1game.Players.PlayerAdded:Connect(function(p)
2    p.CharacterAdded:Connect(function(c)
3        if p.Name = "Your name here" then
4              local ff = Instance.new("ForceField")
5              ff.Visible = false
6              ff.Parent = c
7       end
8    end)
9end)
0
oh k thanks izanagi456 4 — 7y
Ad

Answer this question