local deb = false script.Parent.Touched:connect(function(hit) if deb == false then deb = true local char = hit.Parent local plr = char:GetPlayerFromCharacter(char) if plr:FindFirstChild("Good") then if plr.Good.Stolen.Value == true then print("Stolen") end end else print("Y u n0 w0rk?") end wait(2) deb = false end)
Your problem is that you're attempting to call the GetPlayerFromCharacter()
method from the character, whilst it is a method from Players. Use the method off of game.Players to fix(:
local deb = false script.Parent.Touched:connect(function(hit) if deb == false then deb = true local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if plr and plr:FindFirstChild("Good") then if plr.Good.Stolen.Value == true then print("Stolen") end end else print("Y u n0 w0rk?") end wait(2) deb = false end)
local deb = false script.Parent.Touched:connect(function(hit) if deb == false then deb = true local char = hit.Parent local plr = game.Players:GetPlayerFromCharacter(char) if plr:FindFirstChild("Good") then if plr.Good.Stolen.Value == true then print("Stolen") end end else print("Y u n0 w0rk?") end wait(2) deb = false end)
Instead of char:GetPlayerFromCharacter(char)
you need to do game.Players:GetPlayerFromCharacter(char)
.
Locked by NinjoOnline, EzraNehemiah_TF2, Redbullusa, and BlueTaslem
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?