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
 

Script partially works

Previous Thread :: Next Thread 
Eventive is not online. 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 is not online. 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 is not online. Eventive
Joined: 28 Jul 2011
Total Posts: 9827
26 Jan 2017 10:58 AM
its player gui


ATR'er since 2013.
Report Abuse
galio13 is not online. 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
sircfenner is not online. sircfenner
Joined: 29 Aug 2008
Total Posts: 2430
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 is not online. 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
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