Hi! I want to make the tool give you a perm morph, basically, when you use the tool, It will morph you, but the morph won't go away. This Is a script I made; this script gives you a morph however the morph will disappear when you reset or leave the game, I want It so the morph stays even If you die or leave the game
Also, Im not an advance scripter btw, I just got It by an old post I posted here
Stuff: If your wondering where the morph system Is, the morph system In Inside of the tool, the morph system In not In ReplicatedStorage,ServerStorage,ServerScriptServices,Etc, Its only In the tool
Script:
local tool = script.Parent local Debounce = false local DrinkingAnimation = tool.Animation or tool:WaitForChild("Animation") local Rep = game.ReplicatedStorage local CharacterFolder = Rep.ExclusiveTrolls local char = tool.Parent tool.Activated:Connect(function() if not Debounce and tool.Parent.CanDrink.Value == true then Debounce = true tool:WaitForChild("Drink"):Play() local AnimationTrack = tool.Parent.Humanoid:FindFirstChild("Animator"):LoadAnimation(DrinkingAnimation) AnimationTrack:Play() wait(0.50) tool.Handle.Ice.Transparency = 1 tool.Handle.Oil.Transparency = 1 wait(1) local OilCupTroll = math.random(1,1) if OilCupTroll == 1 then local player = game.Players:GetPlayerFromCharacter(tool.Parent) local plrRoot = player.Character:FindFirstChild("HumanoidRootPart") or player.Character.Parent:FindFirstChild("Torso") local AveragePlayer = CharacterFolder["Reaper"]:Clone() AveragePlayer.Name = player.Name player.Character = AveragePlayer local rootPart = AveragePlayer:FindFirstChild("HumanoidRootPart") or AveragePlayer:FindFirstChild("Torso") if rootPart and plrRoot then rootPart.CFrame = plrRoot.CFrame end AveragePlayer.Parent = workspace AveragePlayer.Humanoid.DisplayName = "Trollge" end if OilCupTroll == 2 then local player = game.Players:GetPlayerFromCharacter(tool.Parent) local plrRoot = player.Character:FindFirstChild("HumanoidRootPart") or player.Character.Parent:FindFirstChild("Torso") local AveragePlayer = CharacterFolder["HD Troll"]:Clone() AveragePlayer.Name = player.Name player.Character = AveragePlayer local rootPart = AveragePlayer:FindFirstChild("HumanoidRootPart") or AveragePlayer:FindFirstChild("Torso") if rootPart and plrRoot then rootPart.CFrame = plrRoot.CFrame end AveragePlayer.Parent = workspace AveragePlayer.Humanoid.DisplayName = "HD Troll" end if OilCupTroll == 3 then local player = game.Players:GetPlayerFromCharacter(tool.Parent) local plrRoot = player.Character:FindFirstChild("HumanoidRootPart") or player.Character.Parent:FindFirstChild("Torso") local AveragePlayer = CharacterFolder["BrickBattler"]:Clone() AveragePlayer.Name = player.Name player.Character = AveragePlayer local rootPart = AveragePlayer:FindFirstChild("HumanoidRootPart") or AveragePlayer:FindFirstChild("Torso") if rootPart and plrRoot then rootPart.CFrame = plrRoot.CFrame end AveragePlayer.Parent = workspace AveragePlayer.Humanoid.DisplayName = "BrickBattler" end Debounce = false tool:Destroy() end end)
Hello! I believe I have found your solution. First of all, go to your game, go to the Home tab, then go to Security and then enable Enable Studio Access to API Services.
Now, onto the code. In your tool:
local tool = script.Parent local Debounce = false local DrinkingAnimation = tool.Animation or tool:WaitForChild("Animation") local Rep = game.ReplicatedStorage local CharacterFolder = Rep.ExclusiveTrolls local char = tool.Parent tool.Activated:Connect(function() if not Debounce and tool.Parent.CanDrink.Value == true then Debounce = true tool:WaitForChild("Drink"):Play() local AnimationTrack = tool.Parent.Humanoid:FindFirstChild("Animator"):LoadAnimation(DrinkingAnimation) AnimationTrack:Play() wait(0.50) tool.Handle.Ice.Transparency = 1 tool.Handle.Oil.Transparency = 1 wait(1) local OilCupTroll = math.random(1,3) if OilCupTroll == 1 then local player = game.Players:GetPlayerFromCharacter(tool.Parent) player.CurrentMorph.Value = "Reaper" local plrRoot = player.Character:FindFirstChild("HumanoidRootPart") or player.Character.Parent:FindFirstChild("Torso") local AveragePlayer = CharacterFolder["Reaper"]:Clone() AveragePlayer.Name = player.Name AveragePlayer.Parent = workspace local rootPart = AveragePlayer:FindFirstChild("HumanoidRootPart") or AveragePlayer:FindFirstChild("Torso") if rootPart and plrRoot then rootPart.CFrame = plrRoot.CFrame end player.Character = AveragePlayer AveragePlayer.Humanoid.DisplayName = "Trollge" end if OilCupTroll == 2 then local player = game.Players:GetPlayerFromCharacter(tool.Parent) player.CurrentMorph.Value = "HD Troll" local plrRoot = player.Character:FindFirstChild("HumanoidRootPart") or player.Character.Parent:FindFirstChild("Torso") local AveragePlayer = CharacterFolder["HD Troll"]:Clone() AveragePlayer.Name = player.Name AveragePlayer.Parent = workspace local rootPart = AveragePlayer:FindFirstChild("HumanoidRootPart") or AveragePlayer:FindFirstChild("Torso") if rootPart and plrRoot then rootPart.CFrame = plrRoot.CFrame end player.Character = AveragePlayer AveragePlayer.Humanoid.DisplayName = "HD Troll" end if OilCupTroll == 3 then local player = game.Players:GetPlayerFromCharacter(tool.Parent) player.CurrentMorph.Value = "BrickBattler" local plrRoot = player.Character:FindFirstChild("HumanoidRootPart") or player.Character.Parent:FindFirstChild("Torso") local AveragePlayer = CharacterFolder["BrickBattler"]:Clone() AveragePlayer.Name = player.Name AveragePlayer.Parent = workspace local rootPart = AveragePlayer:FindFirstChild("HumanoidRootPart") or AveragePlayer:FindFirstChild("Torso") if rootPart and plrRoot then rootPart.CFrame = plrRoot.CFrame end player.Character = AveragePlayer AveragePlayer.Humanoid.DisplayName = "BrickBattler" end Debounce = false tool:Destroy() end end)
Now, create a new script in ServerScriptService. Insert this:
local CharacterFolder = game.ReplicatedStorage.ExclusiveTrolls local store = game:GetService("DataStoreService") local store2 = store:GetDataStore("Morph") function save(p,val) store2:SetAsync(p.UserId,val) end game.Players.PlayerAdded:Connect(function(p) local val = store2:GetAsync(p.UserId) or "" local stringv = Instance.new("StringValue",p) stringv.Name = "CurrentMorph" stringv.Value = val p.CharacterAdded:Connect(function(c) if stringv.Value ~= "" then local oldchar = c local oldv = stringv.Value stringv.Value = "" local plrRoot = p.Character:WaitForChild("HumanoidRootPart") or p.Character.Parent:WaitForChild("Torso") local AveragePlayer = CharacterFolder["BrickBattler"]:Clone() AveragePlayer.Name = p.Name local rootPart = AveragePlayer:FindFirstChild("HumanoidRootPart") or AveragePlayer:FindFirstChild("Torso") if rootPart and plrRoot then rootPart.CFrame = plrRoot.CFrame end p.Character = AveragePlayer AveragePlayer.Parent = workspace AveragePlayer.Humanoid.DisplayName = "BrickBattler" oldchar:Destroy() stringv.Value = oldv end end) end) game.Players.PlayerRemoving:Connect(function(p) local stringv = p:WaitForChild("CurrentMorph") save(p,stringv.Value) end)
Hope this works! Please let me know about any errors (if found)
EDIT 1: Fixed the issue of the character not teleporting to where the player is. :D