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

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

Asked by 8 years ago
Edited 8 years ago

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

Log in to vote
1
Answered by 8 years ago
Edited 8 years ago

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()







0
Thank you! BunnyFilms1 297 — 8y
0
no problem. i hope it works for you :) ace12345678135 50 — 8y
0
Copied my answer haloelite27 25 — 8y
Ad

Answer this question