Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help With Part Cloning?

Asked by 9 years ago

Here's the code:

owner = ""

script.Parent.Touched:connect(function(part)
    if part.Parent and game.Players:playerFromCharacter(part.Parent) then
        local player = game.Players:playerFromCharacter(part.Parent)
        print(player)
        game.Players:FindFirstChild(player.Name).PlayerGui.Turf.Frame.Visible = true
        script.Parent:Destroy()
        owner = player.Name
        print(owner)
    end
end)

function Leaving(owner)
    script.Parent:Clone()
    print(1)
end

player1 = game.Players:FindFirstChild(owner)
player1.PlayerRemoving:connect(Leaving)
print(owner)

The part isn't re-appearing after the owner leaves.

0
You have to set a parent to a parent after you clone it. Also if FilterEnabled is turned on this wouldn't work. FearMeIAmLag 1161 — 9y

Answer this question