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

Making a Game... One Piece I need help, please?

while true do wait(10) Chance = math.random(1,10000) if Chance == 382 then print("Yami Fruit Ganae") Gomu = game.Lighting.DevilFruitModels:FindFirstChild"Gomu Gomu":clone() Gomu.Parent = Workspace Gomu.Base.CFrame = script.Parent.CFrame wait() script.Parent:remove() elseif Chance == 4829 then print("Gomu Fruit Ganae") Bari = game.Lighting.DevilFruitModels:FindFirstChild"Bari Bari":clone() Bari.Parent = Workspace Bari.Base.CFrame = script.Parent.CFrame wait() script.Parent:remove() elseif Chance == 3004 then print("Magu Fruit Ganae") Hana = game.Lighting.DevilFruitModels:FindFirstChild"Hana Hana":clone() Hana.Parent = Workspace Hana.Base.CFrame = script.Parent.CFrame wait() script.Parent:remove() elseif Chance ~= 382 and Chance ~= 4829 and Chance ~= 3004 then print("Nope") wait(10) end end

1 comment

0

you need to add brackets when using FindFirstChild for example the the third line should say game.Lighting.DevilFruitModels:FindFirstChild("Gomu Gomu"):clone()

1 answer

while true do wait(10)
Chance = math.random(1,10000)
if Chance == 382 then
print("Yami Fruit Ganae")
local Gomu = game.Lighting.DevilFruitModels:FindFirstChild("Gomu Gomu"):clone()
Gomu.Parent = workspace
Gomu.Base.CFrame = script.Parent.CFrame
wait()
script.Parent:remove()
elseif Chance == 4829 then print("Gomu Fruit Ganae")
local Bari = game.Lighting.DevilFruitModels:FindFirstChild("Bari Bari"):clone()
Bari.Parent = workspace
Bari.Base.CFrame = script.Parent.CFrame
wait()
script.Parent:remove()
elseif Chance == 3004 then
print("Magu Fruit Ganae")
local Hana = game.Lighting.DevilFruitModels:FindFirstChild("Hana Hana"):clone()
Hana.Parent = workspace
Hana.Base.CFrame = script.Parent.CFrame
wait()
script.Parent:remove()
elseif Chance ~= 382 and Chance ~= 4829 and Chance ~= 3004 then
print("Nope")
wait(10)
end end

Put parentheses around the strings when you are using :FindFirstChild().

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