i am trying to make a door when touched it checks the players kills
function GiveGui(Player) if Player.leaderstats.kills >= 1 then script.Parent.Transparency = 1 script.Parent.CanCollide = false wait (0.5) script.Parent.CanCollide = true script.Parent.Transparency = 0 else Player.PlayerGui.Message.TextLabel.Text = "not enough kills" Player.PlayerGui.Message.TextLabel.Visible = true wait (3) Player.PlayerGui.Message.TextLabel.Visible = false end end
script.Parent.Touched:connect(function(hit)
local Player=game.Players:GetPlayerFromCharacter(hit.Parent) if Player==nil then return end GiveGui(Player)
end)
error:
20:09:20.879 - leaderstats is not a valid member of Player 20:09:20.880 - Script 'Workspace.PaidA.Script', Line 2 - global GiveGui 20:09:20.881 - Script 'Workspace.PaidA.Script', Line 20
