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 » Scripters
Home Search
 

Re: Value change

Previous Thread :: Next Thread 
ItsTreBomb is not online. ItsTreBomb
Joined: 05 Nov 2016
Total Posts: 23
07 Nov 2016 05:27 PM
Please help, I am trying to script a game but I am not too experienced. What I want this script to do is change the value of a string so that it increases when you touch a brick. Here is what I have so far:

part.Touched:connect(function(hit)
if game.Players:findFirstChild(hit.Parent.Name) then
game.StarterGui.Thirst.Water.Thirst.Value = game.StarterGui.Thirst.Water.Thirst.Value - 5
part:Remove()
end
end)
end

If you need anymore info on the scripts, just say what you need :)


Report Abuse
3027474 is not online. 3027474
Joined: 30 Dec 2008
Total Posts: 1636
07 Nov 2016 05:28 PM
You can't add a number to a string.
Report Abuse
ItsTreBomb is not online. ItsTreBomb
Joined: 05 Nov 2016
Total Posts: 23
07 Nov 2016 05:30 PM
Not a string, sorry. It's a DoubleConstrainedValue


Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
07 Nov 2016 05:31 PM
has to be in a local script and also playergui not startergui
Report Abuse
ItsTreBomb is not online. ItsTreBomb
Joined: 05 Nov 2016
Total Posts: 23
07 Nov 2016 05:32 PM
Thank you, but I use the same script to spawn the bricks, and that seems to only work in a nonlocal script. Any way around this?


Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
07 Nov 2016 05:34 PM
Learn about using remote events/functions or values because you cant get the contents of a players playergui (with FE enabled but you shouldnt be doing this anyways) and you need to get each player that joins instead of the local player
Report Abuse
ItsTreBomb is not online. ItsTreBomb
Joined: 05 Nov 2016
Total Posts: 23
07 Nov 2016 05:35 PM
If I open a team create would you mind helping me for a moment or is that too much to ask?


Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
07 Nov 2016 05:38 PM
Teach yourself if you would like, it would make it easier for you to learn other things and it will teach you more that I can. Plus I already am working on a game but I do help people on this forum
Report Abuse
ItsTreBomb is not online. ItsTreBomb
Joined: 05 Nov 2016
Total Posts: 23
07 Nov 2016 05:40 PM
Alright. Thanks! Anyone mind helping me for a quick moment to help me with this?


Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
07 Nov 2016 05:41 PM
http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial

http://wiki.roblox.com/index.php?title=Data_types

https://youtube.com/
Report Abuse
ItsTreBomb is not online. ItsTreBomb
Joined: 05 Nov 2016
Total Posts: 23
07 Nov 2016 07:58 PM
Bump.
Anyone willing to help me correct it?


Report Abuse
Intended_Pun is not online. Intended_Pun
Joined: 10 Aug 2016
Total Posts: 4384
07 Nov 2016 08:21 PM
"game.StarterGui"
Should be
"player.PlayerGui"

The actual GUIs the player sees are in their PlayerGui, not StarterGui.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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