generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Help pls

Previous Thread :: Next Thread 
YumERAGON is not online. 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 is online. 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 is not online. YumERAGON
Joined: 18 Apr 2012
Total Posts: 3893
09 Feb 2014 07:00 PM
Bump
Report Abuse
YumERAGON is not online. 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 is not online. 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 is online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image