What I'm having problems with is having a regen button that will regen a certain car/item with a seat only if there isn't someone sitting on the seat. I'm using the following script, please aid me in telling me what to add. How could I do it?
01
---Place this INSIDE the model. Don't replace the model name or anything.
02
------------------------------------------------------------------------------------------
03
object = script.Parent
04
if (object ~= nil) and (object ~= game.Workspace) then
05
model = object
06
messageText = "regenerating " .. model.Name .. ""
07
08
message = Instance.new("Message")
09
message.Text = messageText
10
backup = model:clone() -- Make the backup
11
waitTime = 255 --Time to wait between regenerations
12
wait(math.random(0, waitTime))
13
while true do
14
wait(waitTime) -- Regen wait time
15
16
message.Parent = game.Workspace
17
model:remove()
18
19
wait(2.5) -- Display regen message for this amount of time
20
21
model = backup:clone()
22
model.Parent = game.Workspace
23
model:makeJoints()
24
message.Parent = nil
25
end
26
end
27
------------------------------------------------------------------------------------------
Thank you.
