I am making a jump ability that costs 30K Panies(Currency Name), But It’s not quite working.
I had to use events when the player buys it then the server will check if he has the amount then it will give him the item.
Script:
local RS = game:GetService("ReplicatedStorage")
local JPU = RS.JUMPPU
local MainGui = game.StarterGui.Shop.MainGui
local JumpPower = MainGui.JumpPu
JPU.OnServerEvent:Connect(function(player)
if player:WaitForChild("leaderstats").Panies.Value == 30000 then
print("Purchase Made")
local char = player.Character
local Human = char:WaitForChild("Humanoid")
Human.UseJumpPower = true
wait(1)
Human.JumpPower = 100
player:WaitForChild("leaderstats").Panies.Value -= 30000
end
end)
It Doesn’t Print "Purchase Made"
LocalScript:
local RS = game:GetService("ReplicatedStorage")
local JPU = RS.JUMPPU
local player = game.Players.LocalPlayer
player.PlayerGui.Shop.MainGui.JumpPu.MouseButton1Up:Connect(function()
JPU:FireServer()
print("Fired")
end)
It Prints "Fired"