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

How do I clone a model onto a character more than once?

Asked by 11 years ago

Example: I want this NVG (http://www.roblox.com/IBH-item?id=132352515) to clone onto my character whenever I touch the giver. A guy told me I need to add in Fire then Spread script into the Head (Giver). It only gives once. How do I make it give more than once? I used this in the Spread script:

01function Spread(part)
02    check = part:findFirstChild("Fire")
03        if check == nil then
04    script.Parent:Clone().Parent = part
05 
06        elseif check ~= nil then
07    check.Size = check.Size +1000000
08    check.Heat = check.Heat  +1000000
09    end
10end
11 
12 
13script.Parent.Parent.Touched:connect(Spread)

3 answers

Log in to vote
1
Answered by
RM0d 305 Moderation Voter
11 years ago

> BEFORE

01function Spread(part)
02    check = part:findFirstChild("Fire")
03        if check == nil then-- if nil create fire
04    script.Parent:Clone().Parent = part
05 
06        elseif check ~= nil then
07    check.Size = check.Size +1000000
08    check.Heat = check.Heat  +1000000
09    end
10end
11 
12 
13script.Parent.Parent.Touched:connect(Spread)

> After

1function Spread(part)
2    check = part:findFirstChild("Fire")
3-- REMOVED IF
4    script.Parent:Clone().Parent = part
5end
6 
7 
8script.Parent.Parent.Touched:connect(Spread)

> any questions comment below... I if helped upvote me please

Ad
Log in to vote
-1
Answered by 11 years ago

Why have the end of the script then put parent.parent?

Log in to vote
-1
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
11 years ago

After line 6, put check = check:clone()

Answer this question