So i got an issue where this gui i made wont go to the player’s playergui. I couldnt find any solutions for this. It works to put in startergui, but not the players playergui
This is the script (its a morph)
local gui = script.Parent.Ability
local pad = script.Parent
local characterName = "Tv"
local character = pad.Parent:WaitForChild(characterName)
local debounce = true
pad.Touched:Connect(function(obj)
local plr = game.Players:GetPlayerFromCharacter(obj.Parent)
if plr and debounce == true then
debounce = false
pad.BrickColor = BrickColor.new("Really red")
local charClone = character:Clone()
local AbilityClone = gui:Clone()
AbilityClone.Parent = plr.PlayerGui --- this is the part where it aint work
charClone.Name = plr.Name
plr.Character = charClone
game.Workspace.Abilitys.AbilityBool.Value = true
local rootPart = charClone:FindFirstChild("HumanoidRootPart") or charClone:FindFirstChild("Torso")
local plrRoot = obj.Parent:FindFirstChild("HumanoidRootPart") or obj.Parent:FindFirstChild("Torso")
if rootPart and plrRoot then
rootPart.CFrame = plrRoot.CFrame
end
charClone.Parent = workspace
wait(5)
pad.BrickColor = BrickColor.new("Lime green")
debounce = true
end
end)