#Need help using a button more than one time then when die it resets

1 messages · Page 1 of 1 (latest)

void field
#

.

tribal lily
#

uhhh

#

resetondeath = false

#

in properties

void field
#

thats not it

#

its like i can only use it one time

tribal lily
#

idk

void field
#

here

#

that help

#

@tribal lily

tribal lily
void field
#

sameee...

azure flume
#

Where is the code?

#

Maybe instead of connecting u did once

#

When player is clickign

void field
#

so what u want to see

azure flume
#

The script when u click on that gui

void field
#

i currenctly have a part that enabels the power button

#

ok

#

use a lil youtube tut in there

#

@azure flume

azure flume
#

What

#

Im trying to understand one sec

void field
#

ok

#

im done also if u do scripts i coul pay u

#

ive been trying to do this for a while

azure flume
#

Can u copy paste the script pls

#

@void field

void field
#

local player = game.Players.LocalPlayer
local button = script.Parent
local event = game:GetService("ReplicatedStorage"):WaitForChild("PowerEvent")
local screenGui = button:FindFirstAncestorOfClass("ScreenGui")
local cooldownLabel = screenGui:WaitForChild("CooldownLabel")

local powers = {
"Explosion", "BigHead","PushEveryone", "SpeedBoost",
"DropBlock","MagnetPull","InvisibleTrap","BulletJump","ConfettiBlast"
}

local cooldownTime = 15
local onCooldown = false

button.MouseButton1Click:Connect(function()
if onCooldown then return end

local canUseFlag = player:FindFirstChild("CanUsePower")
if not canUseFlag or not canUseFlag.Value then
    warn("You must step on the PowerZone first!")
    return
end

local chosenPower = powers[math.random(1, #powers)]
event:FireServer(chosenPower)

local powerLabel = screenGui:FindFirstChild("PowerLabel")
if powerLabel then
    powerLabel.Text = "Power: " .. chosenPower
    powerLabel.Visible = true
    task.delay(2.5, function()
        if powerLabel then powerLabel.Visible = false end
    end)
end

onCooldown = true
button.AutoButtonColor = false
cooldownLabel.Visible = true

for i = cooldownTime, 1, -1 do
    cooldownLabel.Text = "Cooldown: " .. i .. "s"
    task.wait(1)
end

cooldownLabel.Visible = false
button.AutoButtonColor = true
onCooldown = false

-- Reset flag so they have to step on again
if canUseFlag then
    canUseFlag.Value = false
end

end)

#

@azure flume

azure flume
#

and also the on server event @void field

void field
#

what

azure flume
#

you did a remote event

#

to fire the server

void field
#

ya

azure flume
#

can i get the script of what the server do?

void field
worldly gazelleBOT
#

studio** You are now Level 4! **studio

void field
#

@azure flume

azure flume
#

damn this one is quite long 😭

void field
#

ik😭

azure flume
#

can you come in ps

#

pm*

void field
#

whats pm😭

azure flume
#

private message

void field
#

ya

still valve
#

ResetOnSpawn is a property enabled by default on every screen gui