YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
|
| 09 Feb 2014 06:54 PM |
What would I do to set hi to 1 only for the player that touched the thing and keep it as it is to the other players who haven't touched it? Here is the script
hi = 0
function hello(hit) if hit.Parent:findFirstChild("Humanoid") then if hi = 0 then hi = 1 --code end end
script.Parent.Touched:connect(hello) |
|
|
| Report Abuse |
|
|
WebGL3D
|
  |
| Joined: 04 Sep 2013 |
| Total Posts: 28311 |
|
|
| 09 Feb 2014 07:00 PM |
Creating a table, and storing who's touched it might help.
hi = {} function GetHi(player)return hi[player.Name] and 1 or 0 end
function hello(player) player = game.Players:GetPlayerFromCharacter(player.Parent) if(player)then local saidHello = GetHi(player)==1 -- You can use == outside of if statements ;p hi[player.Name] = 1 print(player,"said hello to player before?",saidHello) end end script.Parent.Touched(hello)
~ 1Topcop ~ Java3D ~ WebGL3D ~ Hoard3D ~ Thug3D |
|
|
| Report Abuse |
|
|
YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
| |
|
YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
|
| 09 Feb 2014 07:00 PM |
Oh thanks I didn't see that
And flood check |
|
|
| Report Abuse |
|
|
YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
|
| 09 Feb 2014 07:14 PM |
| this is not what i wanted and doesn't work in the first place |
|
|
| Report Abuse |
|
|
WebGL3D
|
  |
| Joined: 04 Sep 2013 |
| Total Posts: 28311 |
|
|
| 09 Feb 2014 07:20 PM |
Output? And I don't see another way of going about this, without a using a LocalScript
~ 1Topcop ~ Java3D ~ WebGL3D ~ Hoard3D ~ Thug3D |
|
|
| Report Abuse |
|
|
YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
|
| 09 Feb 2014 08:02 PM |
| It ayah trying to call workspace touched a nil value |
|
|
| Report Abuse |
|
|