Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Need help ASAP Script keeps crashing over and over again?

Asked by 5 years ago

I just need help on this simply thing. Please help thanks!

model = game.Workspace.modelnamegoeshere --Change "model" to the name of the model you want to regen.  (IT CAN NOT HAVE CAPS/SPACES.)
messageText = "regening" --Change "regening" to the message you would like to be displayed. (IT CAN NOT HAVE CAPS/SPACES.)

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

while true do
    wait(1) --Change (60) to the number of seconds you would like beetween regenerations.

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

    wait(-10000) --Change (1) to the number of seconds you would like the message to be displayed.

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

All I want to do is delete the message. Also, I just want the model to keep regen. Thanks!

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Local Script in StarterGui

local model = workspace.Model
local messageText = "Regeneration"

local message = script.Parent.ScreenGui.Frame.TextLabel
local message.Text = messageText

while true do
    wait(1) 
    local model2 = model:Clone()

    message.Visible = true
    model:Destroy()

    wait(0)

    model2.Parent = workspace
    --model2:MakeJoints()
    message.Visible = false
end

Alright, so firstly I cleaned up the script, makeJoints needs the "make" to be capitalized, remove is deprecated in favor of Destroy and messages are deprecated (you will need to use a TextLabel instead) The reason the script is probably crashing is due to you having negative time (which isn't possible)

For this example, make sure you have a ScreenGui in the StarterGui named "ScreenGui", a Frame under this named "Frame" and a TextLabel under this named "TextLabel"

In order to remove the message, just don't use it in the script:

local model = workspace.Model

while true do
    local backup = model:clone()
    wait(1) 

    model:Destroy()

    wait(0)

    backup.Parent = workspace
    --backup:MakeJoints()
end
0
Thanks johnneedhelp -72 — 5y
0
So, use this script? johnneedhelp -72 — 5y
0
if you don't want the message, then you dont need anything in the starter gui, this can be used as a local or server script SerpentineKing 3885 — 5y
0
But, I just want to make it so when the model reset the message won't pop up saying "Model regening" johnneedhelp -72 — 5y
0
Never mind i fixed it. johnneedhelp -72 — 5y
Ad

Answer this question