I need more help with some very basic scripting.

_G.RobloxAdvanced.BloodEnabled = false

local parent = script.Parent

local function on()
_G.RobloxAdvanced.BloodEnabled = true

end

local function off()
_G.RobloxAdvanced.BloodEnabled = false

end

local function OnClicked()
if _G.RobloxAdvanced.BloodEnabled == true then off() else on() end

    print ("Blood Toggled")
end
parent.MouseButton1Click:connect(OnClicked)

So how would I make this script not reset on spawn?

It's probably obvious, like every problem I have, but if you can help, please do so.

Thanks.

5 comments

0

Do not use _G, use module scripts instead. Also connect is deprecated use Connect

0

^module scripts dont work that way, theyre the replacement for _G functions, he should use values

0

by values i mean the value instances

0

Not sure, but try script:Destroy() or something

0

Nevermind, read your code and that's not possible with what you're trying to do