Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Does This Script Work For Driving To Earn Money I dont want mess up & then not notice?

Does This Script Work For Driving To Earn Money? Im Not Sure.

local add = 110

script.Parent.Touched:connect(function(hit)
    local character = hit.Parent
    local player = game.Player:GetPlayerFromCharacter(character)
 
    if player then
        if script.Parent:FindFirstChild("SeatWeld") then
            script.Parent.sitting.Value = 1
            wait()
            if script.Parent.Throttle == 1 then
                wait(1)
                local money = stats:FindFirstChild("money")
                money.Value = money.Value + add
            end
        else
            script.Parent.sitting.Value = 0
        end
 
    end
 
end)

1 comment

1

I recommend trying to run the script

1 answer

I don't know much but I think you need to reference the stats.

local add = 110
script.Parent.Touched:connect(function(hit)
    local character = hit.Parent
    local player = game.Player:GetPlayerFromCharacter(character)
    local stats = player.Stats
    if player then
        if script.Parent:FindFirstChild("SeatWeld") then
            script.Parent.sitting.Value = 1
            wait()
            if script.Parent.Throttle == 1 then
                wait(1)
                local money = stats:FindFirstChild("money")
                money.Value = money.Value + add
            end
        else
            script.Parent.sitting.Value = 0
        end

    end

end)

This discussion is preserved as it was. New answers, comments, and votes are closed.