hi robloxians,
i made replace coins to another currency system and there is a problem with the scripts here is the scripts:
give coins script:
game.ReplicatedStorage.ChangeCoinsEvents.GiveCoins.OnServerEvent:Connect(function(plr)
script.Configuration.CoinsToChange.Value = plr:WaitForChild("PlayerGui").ScreenGui.Frame.TextBox.Text
wait(1)
if plr:FindFirstChild("leaderstats").Change.Value >= script.Configuration.CoinsToChange.Value then
plr:FindFirstChild("leaderstats").Coins.Value = plr:FindFirstChild("leaderstats").Coins.Value + script.Configuration.CoinsToChange.Value
plr:FindFirstChild("leaderstats").Change.Value = plr:FindFirstChild("leaderstats").Change.Value - script.Configuration.CoinsToChange.Value
plr:WaitForChild("PlayerGui"):WaitForChild("ScreenGui").Frame.TextBox.Text = ""
else
print("You need more Coins.")
end
end)
Text button script:
script.Parent.TextButton.MouseButton1Click:Connect(function()
game.ReplicatedStorage.ChangeCoinsEvents.GiveCoins:FireServer()
end)
thanks for help.