ive also added prints to both button scripts and came to the conclusion that the button just isnt pressing, this first print statement isnt printing
script.Parent.MouseButton1Click:Connect(function()
print("button presses")
if points.Value >= scprice.Value then
event:FireServer()
print("fired server")
end
end)
so idk what to do
im sorry to be constantly bothering you with this ongoing issue but idk else what do to
Well, firstly, I thought that this problem was in the StarterGui, but as I see it, your gui is in the workspace, and the script simply won’t work. Move it to the StarterGui, and bind the text you want to change, or StarterPlayer > StarterCharacterScripts
You need to drop the script into StarterGui and change it to this one.
local plr = game.Players.LocalPlayer
local Event = script.UpdateEvent
local Button = game:GetService("Workspace"):WaitForChild("upgrader"):WaitForChild("spawncap"):WaitForChild("SurfaceGui"):WaitForChild("Frame"):WaitForChild("Frame"):WaitForChild("button")
--stats--
local statfolder = plr:WaitForChild("statfolder")
local ufolder = plr:WaitForChild("ufolder")
local points = statfolder:WaitForChild("points")
local spawncap = statfolder:WaitForChild("spawncap")
local scprice = ufolder:WaitForChild("scprice")
Button.MouseButton1Click:Connect(function()
print("button presses")
if points.Value >= scprice.Value then
Event:FireServer()
print("fired server")
end
end)
local plr = game.Players.LocalPlayer
local Event = script.UpdateEvent
local Button = game:GetService("Workspace"):WaitForChild("upgrader"):WaitForChild("spawncap"):WaitForChild("SurfaceGui"):WaitForChild("Frame"):WaitForChild("Frame"):WaitForChild("button")
local TextLable = game:GetService("Workspace"):WaitForChild("upgrader"):WaitForChild("spawncap"):WaitForChild("SurfaceGui"):WaitForChild("Frame"):WaitForChild("Frame"):WaitForChild("price")
--stats--
local statfolder = plr:WaitForChild("statfolder")
local ufolder = plr:WaitForChild("ufolder")
local points = statfolder:WaitForChild("points")
local spawncap = statfolder:WaitForChild("spawncap")
local scprice = ufolder:WaitForChild("scprice")
TextLable.Text = scprice.Value
Button.MouseButton1Click:Connect(function()
print("button presses")
if points.Value >= scprice.Value then
Event:FireServer()
print("fired server")
end
end)
scprice:GetPropertyChangedSignal("Value"):Connect(function()
TextLable.Text = scprice.Value
end)