local Tool = script.Parent
local Player = Tool.Parent.Parent
local Handle = Tool.Handle
local Player = game.Players.LocalPlayer
local Character = Player.Character
local sound = Instance.new("Sound")
sound.SoundId = "http://www.roblox.com/asset/?id=165969964"
sound.Parent = script.Parent


Tool.Activated:connect(function(plr)
	sound:play()
	Character.Humanoid.Health = 0
	wait()
end)

it tell me that I attempted to index global "Player" (a nil value)

any fix ?

2 comments

0

You referenced Player two times as a Character and a Player object.

0

If this is a server script, then LocalPlayer is nil.