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

Random tool giver doesnt work?

Asked by 10 years ago

ANSWERED! THANK YOU!

2 answers

Log in to vote
0
Answered by 10 years ago

There's a few things wrong with this script. One thing is that you didn't define what the function handout()is. The other thing is that you didn't say what each of the number in the math.random(1,8)is.

Possible fix (This would be if someone clicked a button they would get it):

function onClicked(Player)
wait(5)
math.random(1,8)
if math.random = 1 then
    local toclone = game.Lighting.Knife
    local cloned = toclone:Clone(Player)
elseif math.random(1,8) = 2 then
    local toclone = game.Lighting.NEXTTOOL
    local cloned = toclone:Clone(Player)
end
end)

script.Parent.MouseButton1Down:connect(onClicked)

I'm sure this is broken in some way so if anybody could tell me what I did wrong that would be appreciated!

0
Well, I dont want it on clicked, i want it like murder mystery PyccknnXakep 1225 — 10y
0
Like when you spawn in a map you randomly be a sheriff or murderer. But i could use this :D PyccknnXakep 1225 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

tkd did it right except he did the connection wrong at the end.

script.Parent.MouseButton1Click:connect(function()
0
True PyccknnXakep 1225 — 10y
0
The connection is right. It also can either be MouseButton1Down, MouseButton1Click, or MouseButton1Up (Not sure about the last one though) CardboardRocks 215 — 10y
0
Nope. digitalzer3 123 — 10y

Answer this question