example: i am the player 1
this is the shop – i wanna achieve like when i press equip i want to morph that burger
like this and also when i die i will respawn with that burger
the problem is when i equip this happen
i made a BoolValue that when the boolvalue is true u will morph that burger
here is the script
game.Players.PlayerAdded:Connect(function(plr)
local SkinValue = Instance.new("Folder")
SkinValue.Parent = plr
SkinValue.Name = "SkinValue"
burger = Instance.new("BoolValue")
burger.Parent = SkinValue
burger.Name = "Burger"
plr.CharacterAppearanceLoaded:Connect(function(chars)
print(plr)
print("character respawn")
----------------------------------------- Burger
if burger.Value == true then
local char = plr.Character
local face = char.Head.face
face:Destroy()
for i, v in pairs(char:GetDescendants()) do
if v:IsA("Part") then
v.Transparency = 1
spawn(function()
for i, v in pairs(char.Parent:GetChildren()) do
if v:IsA("Accessory") == true or v:IsA("CharacterMesh") == true or v:IsA("Shirt") == true or v:IsA("Pants") == true or v:IsA("BodyColors") == true or v:IsA("ShirtGraphic") == true then
v:Destroy()
end
end
end)
wait()
local burger = game.ReplicatedStorage.Skin.Burger
if not char:FindFirstChild("Burger") then
local clone = burger:Clone()
clone.Parent = char
clone.CFrame = char.HumanoidRootPart.CFrame * CFrame.new(0,-1,0)
local weld = Instance.new("WeldConstraint")
weld.Parent = clone
weld.Part0 = clone
weld.Part1 = char.HumanoidRootPart
end
end
end
end -----
this is the triggered event when i press the equip
burgerevent.OnServerEvent:Connect(function(plr)
burger.Value = true
end)
also i want to achieve cuz my really problem is im trying to make a boolvalue that when the value is true u will use the morph so i cant put the value on replicated or serverstorage cuz if i triggered one event player will gonna be morphed so thats why i put it on player