I Have scripted A ClickDetector so whenever a player clicks on a part In Takes away there currency then it gives them and ability this is the script It Just A Normal script Btw that I Used
Or you could use this tricky way of getting players straight from the server-sided script
-- Script
local Button = script.Parent.TextButton
Button.MouseButton1Click:Connect(function()
local Player = script:FindFirstAncestorOfClass("Player") -- Get player that click the gui button
if Player then
print(Player.Name) -- Player that click the button
end
end)
and if you want your point function to be implemented on the gui button then
-- Script
local Button = script.Parent.TextButton
Button.MouseButton1Click:Connect(function()
local Player = script:FindFirstAncestorOfClass("Player")
if Player and Player.leaderstats.Points.Value >= 1000 then
Player.leaderstats.Points.Value = Player.leaderstats.Points.Value - 1000
end
end)