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

Move Models from Lighting to Workspace Dependant on a Value?

Asked by 9 years ago

In my upcoming game, I am wanting certain models to be transfered from Lighitng into Workspace by the Value of an IntValue named "Counter". So, when the server reaches a milstone such as being over an hour old, a bronze trophy appears by the spawn for the server to see. Then after 2 hours, a silver one appears, and so forth. I have no probelms programming the "Counter", but I'm struggling on finding a way for the Models of the Trophies to be transferred from Lighting to Workspace. The server log reports no errors, but the Models are not being transferred after the certain value, so I'm unsure what I'm doing wrong. Here's the current script:

local value = game.Workspace.Counter.Value

local gold = game.Lighting.Prize.Gold

local bronze = game.Lighting.Prize.Bronze

local silver = game.Lighting.Prize.Silver

while true do

01if value > 10 then
02    bronze.Parent = game.Workspace
03end
04 
05if value > 25 then
06    silver.Parent = game.Workspace
07end
08 
09if value > 50 then
10    gold.Parent = game.Workspace
11end
12 
13wait(3)

end

1 answer

Log in to vote
0
Answered by 9 years ago

This would probably replace all the bronze.Parent etc better.

x = bronze:Clone()

x.Parent = game.Workspace

z = silver:Clone()

z.Parent = game.Workspace

b = gold:Clone()

b.parent = game.Workspace

Ad

Answer this question