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

No title will work please read?

Asked by 4 years ago

PLEASE READ: My code won't get past the 24th line

This is in a local script in starter gui

my script:

--Variables--
local Button = script.Parent
local Player = game:GetService("Players").LocalPlayer
local RemoteEvent = game:GetService("ReplicatedStorage").RemoteEvent
local PurchaseButton = script.Parent.BuyPrompt.PurchaseButton
local LeaveButton = script.Parent.BuyPrompt.LeaveButton

--Actual scripting--
script.Parent.MouseButton1Down:Connect(function()
    script.Parent.BuyPrompt.Visible = true
end)

LeaveButton.MouseButton1Down:Connect(function()
    script.Parent.BuyPrompt.Visible = false
end)

PurchaseButton.MouseButton1Down:Connect(function()
    RemoteEvent:FireServer("FourthGun")
end)


local RemoteEvent = game:GetService("ReplicatedStorage").RemoteEvent
local Item = game:GetService("ServerStorage").Guns.FourthGun
RemoteEvent.OnServerEvent:Connect(function(Player, item)
    if item == Item.Name then
        local Cash = Player.leaderstats.Cash
        if Cash.Value >= 50 then
            Cash.Value = Cash.Value - 50
            Item = Item:Clone()
            Item.Parent = Player.Backpack
            else
            print("Not enough cash")
        end
    end
end)
0
Yeah, I had this issue before. I don't know why it doesn't work. Dovydas1118 1495 — 4y
0
What can I do then? Kittymuffin323 -10 — 4y

Answer this question