You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I wanna achive my upgrade button work
What is the issue? Include screenshots / videos if possible!
Issue is - when i click button nothing happens.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tryed to add some loops and debugs, but can’t find error
script:
local PlayersService = game:GetService("Players")
local Player = PlayersService.LocalPlayer
local PlayerGui = Player.PlayerGui
local Points = Player.leaderstats.Points
local MorePointsButton = script.Parent
local UpgradeCost = 2
local GameGUI = PlayerGui.GameGUI
local StatsFolder = GameGUI.GameFrame.PlayableFrame:WaitForChild("Stats")
local PointsMulti = StatsFolder.PointsMulti
local RebirthMulti = StatsFolder.RebirthMulti
MorePointsButton.MouseButton1Click:Connect(function()
if Points == UpgradeCost then
PointsMulti.Value = PointsMulti.Value + (1 * RebirthMulti)
else
return
end
end)
Meaning, let’s say I’m comparing a number with a part. It errors because in logic, you can’t do math operations with a part. This same goes to your Points instance. You’re only referring the Points object itself, not the .Value.