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
 

need help

Previous Thread :: Next Thread 
ZoephixRBLX is not online. ZoephixRBLX
Joined: 04 Nov 2011
Total Posts: 1665
03 Apr 2016 07:23 AM

model = game.Workspace.zip
messageText = ""

message = Instance.new("Message")
message.Text = messageText
backup = model:clone()
enabled = true

function regenerate()
message.Parent = game.Workspace
model:remove()

wait(0)

model = backup:clone()
model.Parent = game.Workspace
model:makeJoints()
message.Parent = nil

script.Disabled = true
script.Parent.BrickColor = BrickColor.new(26)
wait(20)
script.Disabled = false
script.Parent.BrickColor = BrickColor.new(104)
end

function onHit(hit)
if (hit.Parent:FindFirstChild("Humanoid") ~= nil) and enabled then
regenerate()
end
end

script.Parent.Touched:connect(onHit)

--

i dont know where i putted something wrong? the regen works at start when you touch it but after it it doesnt work anymore, anyone has a solution?


Report Abuse
ZoephixRBLX is not online. ZoephixRBLX
Joined: 04 Nov 2011
Total Posts: 1665
03 Apr 2016 07:24 AM
bump


Report Abuse
ZoephixRBLX is not online. ZoephixRBLX
Joined: 04 Nov 2011
Total Posts: 1665
03 Apr 2016 07:27 AM
bump2


Report Abuse
Mike_N is not online. Mike_N
Joined: 25 Feb 2016
Total Posts: 150
03 Apr 2016 07:30 AM
Probably because you never set the clone to a parent so when it does the first part, it deletes the first model and the clone of that model because you never set the clone to a parent so it thinks it's the same model.

backup = model:Clone().Parent = game.Lighting





Report Abuse
Mike_N is not online. Mike_N
Joined: 25 Feb 2016
Total Posts: 150
03 Apr 2016 07:47 AM
Not lighting, sorry.

Guess I didn't explain that correctly.

But say you have one cookie on the counter, and you clone it and it goes on the same counter. You want Cookie1 to be eaten by... whoever but if they're on the same counter the person doesn't know which one is Cookie1.

Same goes in this case, you're cloning the backup however you're not setting it to a parent so it's just going to go with the regular model you used at the start so it's just essentially going to follow it. Also, use a position when cloning these models so they know where to go.

backup:MoveTo(--insert vector3 position)



Report Abuse
Mike_N is not online. Mike_N
Joined: 25 Feb 2016
Total Posts: 150
03 Apr 2016 07:50 AM
Found this in free models, works fine. Just take a part, put this script in. Then take your car or whatever and group the button and the car.

model = script.Parent.Parent--Indicates that the script interacts with the model the button is grouped with.
messageText = ""--If you want a message to appear upon pressing, type it here.

message = Instance.new("Message")
message.Text = messageText
backup = model:clone()
enabled = true

function regenerate()
message.Parent = game.Workspace
model:remove()

wait(2)--Change this number to display the regen message as long as you want in seconds.

model = backup:clone()
model.Parent = game.Workspace
model:makeJoints()
message.Parent = nil

script.Disabled = true
script.Parent.BrickColor = BrickColor.new(26)--Black
wait(10)--Change this number to change the time in between regenerations via the button, in seconds..
script.Parent.BrickColor = BrickColor.new(104)--Purple
script.Disabled = false
end

function onHit(hit)
if (hit.Parent:FindFirstChild("Humanoid") ~= nil) and enabled then
regenerate()
end
end

script.Parent.Touched:connect(onHit)



Report Abuse
ZoephixRBLX is not online. ZoephixRBLX
Joined: 04 Nov 2011
Total Posts: 1665
03 Apr 2016 07:56 AM
I found an solution, i made it so it removed the regen button and then it clones it again from lighting


Report Abuse
ZoephixRBLX is not online. ZoephixRBLX
Joined: 04 Nov 2011
Total Posts: 1665
03 Apr 2016 07:56 AM
But still thanks for your help


Report Abuse
tomytom2 is not online. tomytom2
Joined: 17 Sep 2012
Total Posts: 364
03 Apr 2016 07:58 AM
Need help with A Regen button? Rofl. R U being srs or is this a April fools?
Report Abuse
ZoephixRBLX is not online. ZoephixRBLX
Joined: 04 Nov 2011
Total Posts: 1665
03 Apr 2016 08:00 AM
i'm late but.. you got fooled m8


Report Abuse
tomytom2 is not online. tomytom2
Joined: 17 Sep 2012
Total Posts: 364
03 Apr 2016 08:02 AM
#KnewIt :D

See I'm a boss at life. Hey I saw your chuck'e cheese game its built well. I Got a great development idea. Accept my friend request then party me.
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