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

Roblox tool isn't working due to a nil value?

Asked by 8 years ago

Error I get is

(9) Players.supershadnew.Backpack.Power.Use:10: attempt to index local 'player' (a nil value)

So basically the issue is this is supposed to be a consumable item that creates particles inside the player's character, (attempted to move to torso same outcome) as well as change the characters health and max health, walkspeed, and play music as well as start fog. The item works in studio but not in the actual servers.

(supershadnew is my name obv)

01local tool = script.Parent
02local player = game.Players.LocalPlayer
03 
04tool.Equipped:connect(function(mouse)
05    print("Tool equipped!")
06    tool.Activated:connect(function()
07        local so = game.Soundscape.Meow
08so:Play()
09local blue = Instance.new("ParticleEmitter", player.Character)
10blue.VelocitySpread = 360
11blue.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 0.2)})
12blue.Name = "blue"
13blue.LightEmission = 0.4
15blue.Color = ColorSequence.new(Color3.new(0.709804, 0.85098, 1), Color3.new(0.941177, 0.109804, 1))
View all 46 lines...

Answer this question