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

I can't make a script button that when you click the button it change the color of the flashlight ?

Asked by 5 years ago

My script w'ont stop buying when i have already clicked and buy the color

local plr = game.Players.LocalPlayer
local char = plr.Character  

Buyed = false
IsNotBuy = false

script.Parent.MouseButton1Click:Connect(function()
    Buyed = true
    if Buyed == true then
        local flashlight = char.HumanoidRootPart:WaitForChild("player_flashlight")
        flashlight.Color = Color3.fromRGB(255,0,0)
        game.ReplicatedStorage.Click:Play()
        if IsNotBuy == false then
            plr.Leaderstats.OriCash.Value = plr.Leaderstats.OriCash.Value - 1700
            IsNotBuy = true
        end
        Buyed = false
    end

end)
0
two words: Filtering Enabled theking48989987 2147 — 5y

Answer this question