ok, here is what I have.
Inside workspace I have Child (Tycoons)
Inside Tycoons I have Child (BrightBlue)
Inside BrightBlue I have Child (Purchases)
Inside Purchases I have Child (BaseWall)
Inside BaseWall I have Child (Model)x100 or so
Inside each Model I have Child (Humanoid) with health at 1000
Now, I need a script that will make the Humanoid Health set at 1000 ( the blocks can be killed already)
The script will be attached to a button here is were it is located
Inside workspace I have Child (Tycoons)
Inside Tycoons I have Child (BrightBlue)
Inside BrightBlue I have Child (Purchases)
Inside Purchases I have Child (RegenerationBuilding)
Inside RegenerationBuilding I have Child (Buttons)
Inside Buttons I have Child (Regenerate Base Walls - $Price (this is the button))
Inside the Button I have Child (script) Named Regeneration
I know it was long but I hope you understand what I am asking.
Here is the script that I have
objects = {} teamcolor = BrickColor.new(script.Parent.Name) wait(1) script.Parent.Essentials.Spawn.TeamColor = teamcolor script.Parent.Essentials.Spawn.BrickColor = teamcolor script.Parent.Touched:connect(function(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player ~= nil then if script.Parent.Owner.Value == player then if hit.Parent:FindFirstChild("Humanoid") then if hit.Parent.Humanoid.Health > 0 then local cashmoney = game.ServerStorage.MoneyStorage:FindFirstChild(player.Name) if cashmoney ~= nil then cashmoney.Value = cashmoney.Value + script.Parent.Cash.Value script.Parent.Cash.Value = 0 end end end end end end) Workspace.Tycoons.BrightBlue.Purchases.BaseWall:WaitForChild("BaseWall") for i,v in pairs(script.Parent.Parent.BaseWall:GetChildren()) do if v:FindFirstChild("Model") then v.Humanoid.Health = 1000 v.Part.Transparency = 1 v.Part.CanCollide = false end end) -- After 30 seconds, allow the model to be regenerated again wait(30)
This script is designed to make sure that the person clicking it is the owner of the base, alive, has the cash to buy it and a 30 sec timer.
that's all I can think of if you have any other ideas feel free to add....
Thanks for what ever help you can give
Instead of v.Humanoid.Health = 1000
i would recommend v.Humanoid.Health = v.Humanoid.MaxHealth
.