|
| 31 Dec 2015 02:30 AM |
does anyone have any idea why the script below only works once? it's the almost universal regen script for weapons on SFotH places you can pick it up, and it will respawn, but when it needs to respawn again after that it won't.
---SCRIPT BELOW---
bin = script.Parent
ItemName = "Windforce" -- The name of the item in the stand. WaitTime = 5 -- The amount of time to wait before regenerating the item.
Item = bin:findFirstChild(ItemName) backup = Item:clone()
function regen() local regen = backup:clone() regen.Parent = bin end
debounce = false function onTaken(property) if (debounce == true) then return end debounce = true if (bin:findFirstChild(ItemName) == nil) then wait(WaitTime) regen() print("regenWind") end debounce = false end
Item.Changed:connect(onTaken) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
|
| 01 Jan 2016 12:37 AM |
local Item = script.Parent:FindFirstChild'WindForce' local Clone = Item:Clone()
Item.Changed:connect(function() if not script.Parent:FindFirstChild(Item.Name) then wait(5) Clone:Clone().Parent = script.Parent end end) |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2016 04:53 AM |
| just like the other script, it respawns, but it only does it once. are there other factors affecting it? |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2016 06:27 AM |
| http://wiki.roblox.com/index.php?title=Intro_to_Scripting |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2016 10:27 AM |
"http://wiki.roblox.com/index.php?title=Intro_to_Scripting"
i choose to ignore idiots like you and thus, b5 |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2016 10:46 AM |
local Item = script.Parent:FindFirstChild'WindForce' local Clone = Item:Clone()
function Check(Item2) if not script.Parent:FindFirstChild(Item2.Name) then wait(5) local Weapon = Clone:Clone() Weapon.Parent = script.Parent Weapon.Changed:connect(function() Check(Weapon) end) end end
Item.Changed:connect(function() Check(Item) end)
When I looked up "Ninjas" in Thesaurus.com, it said "Ninja's can't be found" Well played Ninjas, well played. |
|
|
| Report Abuse |
|
|