Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited 4 years ago

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
I recommend trying to run the script Shubu13 29 — 4y

1 answer

Log in to vote
0
Answered by
Shubu13 29
4 years ago
Edited 4 years ago

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)
Ad

Answer this question