I'm trying to make a invisible script so whenever I press M I will be able to stay invisible for 9999 seconds or mostly forever I tried to use one of my old script to do it and still never worked out. Please help me fix this.
Invisible script
local settings = { --This is a table, this table will store all the variables that you can change.
damageTime = 1, -- How many times It will damage the player
inbetweenTime = .1, -- The time you have to wait until It damages again
damage = 0, -- How much damage it will do
Transparency = false,
Transparency = false,
timeUntilUse = 15, -- Change this to the time you want it to wait until you can punch again
}
repeat wait() until game.Players.LocalPlayer.Character
function onKeyPress(inputObject,gameProcessedEvent)
settings.Transparency = false
if inputObject.KeyCode == Enum.KeyCode.M and not settings.Transparency then
settings.Transparency = true
game.Players.LocalPlayer.Character.HumanoidRootPart.Touched:Connect(function(hit) --[[ This is a function which will fire when it is touched, make sure to put the player you want in the brackets w/ .HumanoidRootPart --]]
if inputObject.KeyCode == Enum.KeyCode.M and settings.Transparency == true then --[[ This will check if it hits something w/ a humanoid --]]
for i = 1,settings.damageTime do
if not settings.Transparency then
settings.Transparency = true
wait(settings.inbetweenTime) -- this will wait for the time classified in settings.
settings.Transparency = 2
end
end
wait(settings.timeUntilUse)
settings.Transparency = 2
end
end)
end
end
game:GetService('UserInputService').InputBegan:Connect(onKeyPress)

1 comment
Lol its kinda crazy Atm