Eventive
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 9827 |
|
|
| 26 Jan 2017 10:44 AM |
When scores value is equal to 255 it doesn't disable the script. Score is a IntValue
game.Workspace:WaitForChild("Touch").Touched:connect(function(hit) if hit.Parent.Humanoid then script.Parent.Score.Value = script.Parent.Score.Value +25 script.Parent.Size = script.Parent:TweenSize(UDim2.new(0,script.Parent.Score.Value, 0.8, 0)) if script.Parent.Score.Value == 225 then script.Disabled = true end end end)
ATR'er since 2013. |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 26 Jan 2017 10:54 AM |
-- You're tweening incorrectly, make sure to check the output when something doesn't work. -- Whose GUI is this in..? If the player's, then we should be doing something different...
local sp = script.Parent -- you might need a debounce too workspace:WaitForChild("Touch").Touched:connect(function(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then sp.Score.Value = sp.Score.Value+25 sp:TweenSize(UDim2.new(0,sp.Score.Value,0.8,0),"Out","Quad",.5) end end)
|
|
|
| Report Abuse |
|
|
Eventive
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 9827 |
|
|
| 26 Jan 2017 10:58 AM |
its player gui
ATR'er since 2013. |
|
|
| Report Abuse |
|
|
galio13
|
  |
| Joined: 20 Jul 2011 |
| Total Posts: 842 |
|
|
| 26 Jan 2017 11:06 AM |
game.Workspace:WaitForChild("Touch").Touched:connect(function(hit) if hit.Parent.Humanoid then script.Parent.Score.Value = script.Parent.Score.Value +25 script.Parent:TweenSize(UDim2.new(0,script.Parent.Score.Value, 0.8, 0)) if script.Parent.Score.Value == 225 then script.Disabled = true end end end)
|
|
|
| Report Abuse |
|
|
|
| 26 Jan 2017 12:28 PM |
| You should use >=225 to catch unexpected cases where the score surpasses 225 without ever equalling 225. I assume this is what you want. |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 26 Jan 2017 12:33 PM |
If he's only ever adding by 25 then at some point it will have to be 225 unless he decides to change up the increments It's not like he's adding 3 and checking for 100, but yes there's no harm done in saying >=225
I think I was going to get around to that part of the script but it totally slipped my mind. The tweening was the big issue.
|
|
|
| Report Abuse |
|
|