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

Random tool giver doesnt work?

ANSWERED! THANK YOU!

2 answers

✓ Accepted answer

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!

2 comments

0

Well, I dont want it on clicked, i want it like murder mystery

0

Like when you spawn in a map you randomly be a sheriff or murderer. But i could use this :D

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

script.Parent.MouseButton1Click:connect(function()

3 comments

0

True

0

The connection is right. It also can either be MouseButton1Down, MouseButton1Click, or MouseButton1Up (Not sure about the last one though)

0

Nope.

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