Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to add an un-union function to a script?

Hi, so here I have a script that will cause the unioned parts to turn black and unanchor but what line of Lua do I add after "script.Parent.BrickColor = BrickColor.new("Really black")?"

What I need is a line of Lua that will cause the bricks to un-union. Thanks!

local tree = script.Parent
print("treeSpawned")
wait (2)
script.Parent.BrickColor = BrickColor.new("Really black")
tree.Anchored = false
wait(3)
tree:Destroy()
print ("treeDied")

1 answer

✓ Accepted answer

How about we come up with a different solution. instead of separating the unions, how about you make 2 different copies of the same model, one unioned, and one separated. Put the seperated model into replicated storage. from what i see, your trying to make a tree that turns black and falls apart when something happens to it. so im going to wing this

local tree = script.Parent
local DeadTree = game.ReplicatedStorage.DeadTree -- this tree should already be colored really black.

print("tree spawned")
wait(2)
local PlaceMarker = Instance.New("Part")
PlaceMarker.Name = "PlaceMarker"
PlaceMarker.CanCollide = false
PlaceMarker.Position = tree.Position
tree:Destroy()
print("Spawning Dead Tree")
local newtree = DeadTree:Clone()
newtree.Parent = workspace -- just in case it doesnt work
newtree.Position = PlaceMarker.Position
newtree.Anchored = false
PlaceMarker:Destroy() -- Eddited in to take away the ugly part
wait(3)
newtree:Destroy()







3 comments

0

Thank you!

0

no problem. i hope it works for you :)

0

Copied my answer

This discussion is preserved as it was. New answers, comments, and votes are closed.