I have a button and when you press it, it basically makes your character look like santa. But the problem is when you die your player obviously resets so you no longer look like santa.
How would you go about making the clothing a permanent change until the clothing was deleted by another script.
Heres the script that changes the way your character looks, it does more than just change your character so try to ignore the other stuff.
local replicatedstorage = game:GetService("ReplicatedStorage") local givetool = replicatedstorage:WaitForChild("GiveThompson") local player = game.Players.LocalPlayer local button = script.Parent:WaitForChild("Play") local clothingstorage = game.Workspace.Clothing local shirt = clothingstorage:FindFirstChild("SantaShirt") local pants = clothingstorage:FindFirstChild("SantaPants") button.MouseButton1Click:connect(function() givetool:FireServer() script.Parent.Parent.Enabled = false player.Character:FindFirstChild("Pants"):Destroy() player.Character:FindFirstChild("Shirt"):Destroy() shirt:Clone().Parent = player.Character pants:Clone().Parent = player.Character wait(1) script.Parent.Parent:Destroy() end)
Hopefully someone can help me out, I know it cant be too complex. I think I may be over thinking it, I was gonna go and custom load characters and on loading the character check which GUI they pressed and then set the clothing accordingly. But ive seen some very basic games have clothing through death so it cant be to complex.
Thank you for your time hopefully we can solve this problem :)
You could use the PlayerAdded
, CharacterAdded
, and Died
events on the server to track whenever a player dies. Change them back to a santa if they were one
game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(c) c:WaitForChild("Humanoid").Died:Connect(function() plr.CharacterAdded:Wait(); print("spawned after death"); --Turn into santa again if they were one end) end) end)