|
| 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
|
  |
| Joined: 30 Dec 2008 |
| Total Posts: 1636 |
|
|
| 07 Nov 2016 05:28 PM |
| You can't add a number to a string. |
|
|
| Report Abuse |
|
|
|
| 07 Nov 2016 05:30 PM |
Not a string, sorry. It's a DoubleConstrainedValue
|
|
|
| Report Abuse |
|
|
|
| 07 Nov 2016 05:31 PM |
| has to be in a local script and also playergui not startergui |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 07 Nov 2016 05:40 PM |
Alright. Thanks! Anyone mind helping me for a quick moment to help me with this?
|
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 07 Nov 2016 07:58 PM |
Bump. Anyone willing to help me correct it?
|
|
|
| Report Abuse |
|
|
|
| 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 |
|
|