Hello!
I want to modify this script so that If you use the tool (Via activation) you will morph Into a morph permanently. When I mean permanently, I mean If you reset or leave the game, It will still have the morph on you, however, Im making a system where you can switch morphs to a default morph, so don't worry about It
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 then Debounce = true tool:WaitForChild("Drink"):Play() local AnimationTrack = tool.Parent.Humanoid:FindFirstChild("Animator"):LoadAnimation(DrinkingAnimation) AnimationTrack:Play() wait(1.5) local player = game.Players:GetPlayerFromCharacter(tool.Parent) local plrRoot = player.Character:FindFirstChild("HumanoidRootPart") or player.Character.Parent:FindFirstChild("Torso") local AveragePlayer = CharacterFolder["Biblically accurate One-Shot"]: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 = "Something" Debounce = false tool:Destroy() end end)
save via strings or objects might be very bad module
local module = {} local DataStore = game:GetService("DataStoreService") local RunS = game:GetService("RunService") function module.SaveObject(Key,Value,DataStoreName) if RunS:IsClient() then error("Run in Server") end local DS = DataStore:GetDataStore(DataStoreName) local success,Error = pcall(function() DS:SetAsync(Key,Value) end) if success then return true else return error(Error) end end function module.GetObject(Key,Value,DataStoreName) if RunS:IsClient() then error("Run in Server") end local DS = DataStore:GetDataStore(DataStoreName) local Data local success,Error = pcall(function() Data = DS:GetAsync(Key) end) if success then return Data else return error(Error) end end return module
script
local Module = require(PathToModule) --place Module.SaveObject(Player.UserId,Name of Morph,"PlayerMorphs") when you are trying to save (you can also use Datastore3) and when accessing data local Data = Module.GetObject(Player.UserId,"PlayerMorphs") if Data then equipMorph(ListOfMorphs[Data]:Clone()) --assuming you have a morph equipping system end