The below code must be wrong, and I believe it's something to do with my use of elseif statements, could someone check it? The script prints "not creator", even though it shouldn't.
Function:
I want the script to check for vip3, vip2 and vip1, if they're present, remove them and clone the 'creator' into the Player's head.
local Names = {cokePanda = true}
local creator = game.ServerStorage.creator:Clone()
game.Players.PlayerAdded:connect(function(p)
local char = p.CharacterAdded:connect(function(char)
if Names[p.Name] then
local vip3 = char.Head:findFirstChild("vip3")
local vip2 = char.Head:findFirstChild("vip2")
local vip1 = char.Head:findFirstChild("vip1")
if vip3 then
vip3:Remove()
elseif vip2 then
vip2:Remove()
elseif vip1 then
vip1:Remove()
creator.Parent = char.Head
print("is creator")
else
print("not creator")
end
end
end)
end) |