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

My Remove event isn't working properly?? [closed]

Asked by 6 years ago

Ok, so I have a remote event going from a GUI local script to a leaderboard script and it wont take the money away. Here are the scripts. This is probably a easy mistake....

local script from GUI

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local createPartEvent = ReplicatedStorage:WaitForChild("CreatePartEvent")

createPartEvent:FireServer()

            script.Parent.Text = "Spawn"
        end
    end
end)



leaderboard script

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local createPartEvent = Instance.new("RemoteEvent", ReplicatedStorage)
createPartEvent.Name = "CreatePartEvent"

local function onCreatePartFired(player)
    local PriceOfItem = game.ReplicatedStorage:WaitForChild("CheckPrice"):InvokeServer(script.Parent.StarterGui.PurchaseGUI.ScrollingFrame.Jugatti.Name)
    game.Players.player.leaderstats.Cash.Value = game.Players.player.leaderstats.Cash.Value - PriceOfItem
            script.Parent.StarterGui.PurchaseGUI.ScrollingFrame.Jugatti.Purchased.Value = true
end

createPartEvent.OnServerEvent:Connect(onCreatePartFired)
0
Why are there three random end statements in the local script? T0XN 276 — 6y

Closed as Non-Descriptive by User#19524

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?