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: Regen not working

Previous Thread :: Next Thread 
bladeclone is not online. bladeclone
Joined: 06 Jul 2009
Total Posts: 2179
16 Aug 2014 01:51 PM
You touch the button and the model 'Pickup' is supposed to regenerate if you own the tycoon it is a part of, however, this does not work at all.



button = script.Parent

regen = button.Parent.Regen

tycoon = script.Parent.Parent.Parent



local debounce = false



script.Parent.Head.Touched:connect(function(h)
local player = game.Players:GetPlayerFromCharacter(h.Parent)
if not (player) then return end
if (active) then return end
debounce = true
if (tycoon.Owner.Value ~= player) then
msg("This is not your " .. tycoon.Parent.NameOfTycoon.Value .. "!","Message",3,player)
debounce = false
return
end


if h ~= nil and debounce == false then

debounce = true

button.BrickColor = BrickColor.Black()

regen.Value = 1

wait()

regen.Value = 0

wait(5)

button.BrickColor = BrickColor.new(104)

debounce = false

end

end


button.Touched:connect(onTouch)
Report Abuse
bladeclone is not online. bladeclone
Joined: 06 Jul 2009
Total Posts: 2179
16 Aug 2014 03:33 PM
Bump
Report Abuse
bladeclone is not online. bladeclone
Joined: 06 Jul 2009
Total Posts: 2179
16 Aug 2014 04:30 PM
Bump
Report Abuse
bladeclone is not online. bladeclone
Joined: 06 Jul 2009
Total Posts: 2179
16 Aug 2014 06:23 PM
Bump
Report Abuse
ExtraTelamon is not online. ExtraTelamon
Joined: 26 Dec 2011
Total Posts: 4629
16 Aug 2014 06:32 PM
this isn't a regen script

it finds the player then if he isnt owner of the tycoon it gives him a message

then it sets the value of "regen"

where is the regen part
Report Abuse
bladeclone is not online. bladeclone
Joined: 06 Jul 2009
Total Posts: 2179
16 Aug 2014 06:36 PM
This activates the regen script. The regen script works fine, this is where the problem lies, it's not activating regen script.
Report Abuse
ExtraTelamon is not online. ExtraTelamon
Joined: 26 Dec 2011
Total Posts: 4629
16 Aug 2014 06:39 PM
is regen a stringvalue?
Report Abuse
bladeclone is not online. bladeclone
Joined: 06 Jul 2009
Total Posts: 2179
16 Aug 2014 06:56 PM
intvalue.
when it's 1 the model regens
Report Abuse
ExtraTelamon is not online. ExtraTelamon
Joined: 26 Dec 2011
Total Posts: 4629
16 Aug 2014 07:05 PM
well then maybe its the part of the regen script that regens when the value is 1
Report Abuse
ExtraTelamon is not online. ExtraTelamon
Joined: 26 Dec 2011
Total Posts: 4629
16 Aug 2014 07:08 PM
local regen = ______

while true do
if regen.Value =~ 0 then


BLAH BLAH BLAH



wait()
end
Report Abuse
iSwordFights is not online. iSwordFights
Joined: 07 Nov 2010
Total Posts: 358
16 Aug 2014 07:08 PM
To regen a model you have to create a backup copy of it using :copy() to have a backup before it was moved somewhere else. Then, once you're ready for it, just give the copy a parent, then make a new copy. For example:


c = regen:copy()

wait(5)

c.Parent = game.Workspace
c = c:copy()



Something like that.
Report Abuse
ExtraTelamon is not online. ExtraTelamon
Joined: 26 Dec 2011
Total Posts: 4629
16 Aug 2014 07:09 PM
^ he already said when regen value is 1 the regen activates
Report Abuse
bladeclone is not online. bladeclone
Joined: 06 Jul 2009
Total Posts: 2179
17 Aug 2014 11:20 AM
No, I'm quite sure the rest of the script is quite fine as it works perfectly before I added in the tycoon owner part, that seems to break it but I'm not sure why.
Report Abuse
bladeclone is not online. bladeclone
Joined: 06 Jul 2009
Total Posts: 2179
17 Aug 2014 02:55 PM
Bump
Report Abuse
bladeclone is not online. bladeclone
Joined: 06 Jul 2009
Total Posts: 2179
17 Aug 2014 04:46 PM
Bump
Report Abuse
bladeclone is not online. bladeclone
Joined: 06 Jul 2009
Total Posts: 2179
18 Aug 2014 09:51 AM
Bump
Report Abuse
bladeclone is not online. bladeclone
Joined: 06 Jul 2009
Total Posts: 2179
18 Aug 2014 11:49 AM
Bump
Report Abuse
blooo127127 is not online. blooo127127
Joined: 22 Jul 2010
Total Posts: 403
18 Aug 2014 12:00 PM
Change regen to a bool value. Change the value to true when you want to regenerating and have the regeneration script do w/e then change the value to false, not the owner script.

-- regen script
regen = script.Regen
regen.Changed:connect(function()
if not regen.Value then return end
--do stuff
regen.Value = false
end)
Report Abuse
bladeclone is not online. bladeclone
Joined: 06 Jul 2009
Total Posts: 2179
19 Aug 2014 09:40 AM
Well, as I said, the script works fine without the tycoonowner part, are you sure this will fix the problem?
Report Abuse
bladeclone is not online. bladeclone
Joined: 06 Jul 2009
Total Posts: 2179
24 Aug 2014 02:42 PM
bump
Report Abuse
bladeclone is not online. bladeclone
Joined: 06 Jul 2009
Total Posts: 2179
24 Aug 2014 03:34 PM
Bump.
Report Abuse
bladeclone is not online. bladeclone
Joined: 06 Jul 2009
Total Posts: 2179
24 Aug 2014 05:09 PM
Bump.
Report Abuse
bladeclone is not online. bladeclone
Joined: 06 Jul 2009
Total Posts: 2179
25 Aug 2014 09:16 AM
Bump.
Report Abuse
bladeclone is not online. bladeclone
Joined: 06 Jul 2009
Total Posts: 2179
25 Aug 2014 12:24 PM
Bump
Report Abuse
bladeclone is not online. bladeclone
Joined: 06 Jul 2009
Total Posts: 2179
03 Sep 2014 03:35 PM
Bump.
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