Roblox Forum banner

error: 'localplayer is not a valid member of Players "Players"'

767 views 1 reply 2 participants last post by  miszol 
#1 ·
Im trying to set a variable as a value which gets placed into the local player but i keep getting an error for it
code:

Torso = workspace.Noob.Torso
Noob = workspace.Noob
knife = game.StarterPack.Knife
local player = game:GetService("Players").LocalPlayer
stabs = player.Stabs
db = false

function OnTouch(knife)
if db == false then
db = true
Noob.Humanoid:TakeDamage(10)
wait(.5)
db = false
end
end

script.Parent.Touched:Connect(OnTouch)
 
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top