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!

1local tree = script.Parent
2print("treeSpawned")
3wait (2)
4script.Parent.BrickColor = BrickColor.new("Really black")
5tree.Anchored = false
6wait(3)
7tree:Destroy()
8print ("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

01local tree = script.Parent
02local DeadTree = game.ReplicatedStorage.DeadTree -- this tree should already be colored really black.
03 
04print("tree spawned")
05wait(2)
06local PlaceMarker = Instance.New("Part")
07PlaceMarker.Name = "PlaceMarker"
08PlaceMarker.CanCollide = false
09PlaceMarker.Position = tree.Position
10tree:Destroy()
11print("Spawning Dead Tree")
12local newtree = DeadTree:Clone()
13newtree.Parent = workspace -- just in case it doesnt work
14newtree.Position = PlaceMarker.Position
15newtree.Anchored = false
16PlaceMarker:Destroy() -- Eddited in to take away the ugly part
17wait(3)
18newtree: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