Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loadstring(game:HttpGet(('https://raw.githubusercontent.com/ToonX056Script/main/gofishing)))() #4561

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ToonX056Script
Copy link

-- Service to handle players
local Players = game:GetService("Players")

-- Function to add money to a player
local function addMoney(player, amount)
-- Check if the player has a leaderstats folder
local leaderstats = player:FindFirstChild("leaderstats")
if leaderstats then
local money = leaderstats:FindFirstChild("Money")
if money then
money.Value = money.Value + amount
end
end
end

-- Create a leaderstats folder when a player joins Players.PlayerAdded:Connect(function(player)
-- Create leaderstats folder
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player

-- Create a Money value
local money = Instance.new("IntValue")
money.Name = "Money"
money.Value = 0 -- Initial money
money.Parent = leaderstats

end)

-- Example: Adding a button to give money
local button = Instance.new("TextButton")
button.Text = "Add Money"
button.Size = UDim2.new(0, 200, 0, 50)
button.Position = UDim2.new(0.5, -100, 0.5, -25)
button.Parent = game.StarterGui.ScreenGui

-- Add money when the button is clicked
button.MouseButton1Click:Connect(function()
local player = Players.LocalPlayer
if player then
addMoney(player, 100) -- Add 100 money
end
end)

Reasons for making this change:

TODO

Links to documentation supporting these rule changes:

TODO

If this is a new template:

  • Link to application or project’s homepage: TODO

-- Service to handle players
local Players = game:GetService("Players")

-- Function to add money to a player
local function addMoney(player, amount)
    -- Check if the player has a leaderstats folder
    local leaderstats = player:FindFirstChild("leaderstats")
    if leaderstats then
        local money = leaderstats:FindFirstChild("Money")
        if money then
            money.Value = money.Value + amount
        end
    end
end

-- Create a leaderstats folder when a player joins
Players.PlayerAdded:Connect(function(player)
    -- Create leaderstats folder
    local leaderstats = Instance.new("Folder")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = player

    -- Create a Money value
    local money = Instance.new("IntValue")
    money.Name = "Money"
    money.Value = 0 -- Initial money
    money.Parent = leaderstats
end)

-- Example: Adding a button to give money
local button = Instance.new("TextButton")
button.Text = "Add Money"
button.Size = UDim2.new(0, 200, 0, 50)
button.Position = UDim2.new(0.5, -100, 0.5, -25)
button.Parent = game.StarterGui.ScreenGui

-- Add money when the button is clicked
button.MouseButton1Click:Connect(function()
    local player = Players.LocalPlayer
    if player then
        addMoney(player, 100) -- Add 100 money
    end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant