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

I need help with a OnTouch Script?

So what I'm trying to do is make it so when the first 3 ROBLOX players touch a part then they get 1 win and they get 20 points for the first person there, 15 for the 2nd, and 10 for the 3rd.

1 comment

0

Can you post the script

2 answers

This is the script, I don't exactly know what to do next though.`function onTouch()

end script.Parent.Touched:connect(onTouch)`

7 comments

0

1st you need a place to store all 3 players e.g plr1, plr2, plr3

0

Okay.

0

on the last player hitting the part you should then give the point to the player, if your game works like this

0

How am I supposed to store the players?

0

probably the easyest way would be to include somthing like this local pl1, pl2, pl3 = nil. then store the players name.

0

so in the function you would check if pl1 = nil then pl1 = find the player name here esleif pl2 ect

0

Edit your question. Don't post an answer.

function onTouch()
--IDK THIS im just LUA Blocking his code
end
script.Parent.Touched:Connect(onTouch)

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