Making A Simple Simulator game on roblox and im using remote events to buy tools for cash (or as i refer to it as "Halopower" )
and the button detects its being clicked but does not fire the event OR the server script does not pick it up
local script firing it:
local btnText = script.Parent.TextLabel
local btn = script.Parent
local repStorage = game:GetService("ReplicatedStorage")
btn.MouseButton1Click:Connect(function()
repStorage.Remotes.BuyMolten:FireServer()
end)
server script "suppose to be" detecting it
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local remoteEvent = ReplicatedStorage:WaitForChild("BuyMolten")
local btnText = game.Players:WaitForChild("PlayerGui").ShopUI.Frame.BuyMolten.TextLabel.Text
local toolFolder = game.ServerStorage.ShopItems
local toolPrice = 150
remoteEvent.OnServerEvent:Connect(function(player)
print("FireServerDetectedFromBuyTool")
if player.leaderstats.Halopower.Value >= toolPrice then
player.leaderstats.Halopower.Value = player.leaderstats.Halopower - toolPrice
toolFolder:FindFirstChild("Molten Halo"):Clone().Parent = player.Backpack
end
end)
if needed i will include code from other parts of the game like data stores remotes stats and more.
thanks, Joe Engo (aka MightBeAHaxxer / MightBeAScripter)

3 comments
local script is in startergui and the server script is in SSS (ServerScriptService) i will add waitforchild now
Also if I'd advise against giving out your real name on this website.
not my real name just my discord :D