This script is by someone named "sparks" yuh
Update: On output when "I sit on the seat it says " 20:37:19.022 - Workspace.Seat.Script:16: invalid argument #2 (string expected, got Instance)"

and "20:40:20.735 - Stack Begin 20:40:20.738 - Script 'Workspace.Seat.Script', Line 16 20:40:20.739 - Stack End"

-- Script should be inside the seat
local Seat = script.Parent
local Players = game:GetService("Players")

Seat:GetPropertyChangedSignal("Occupant"):Connect(function()
    --Get seat occupant
    local humanoid = Seat.Occupant

    --Check to make sure seat is not empty
    if humanoid == nil then return end

    --Get the player sitting in the seat
    local occupant = Players:GetPlayerFromCharacter(humanoid.Parent)

    --Get that player's seconds from the leaderboard
    local Money = Players[occupant].leaderstats.Money   

    --Increment their seconds on the leaderboard by 1 while sitting
    while Seat.Occupant == humanoid do wait (1)
        Money.Value += 1
    end
end)

8 comments

0

Is there an error?

0

No

0

wait lemm check

0

yes it says " 20:37:19.022 - Workspace.Seat.Script:16: invalid argument #2 (string expected, got Instance)" when i sat on the seat

0

Oh right, I forgot to index the Name property. I updated the code.

0

If you didn't read the update, change Players[occupant] to just occupant.leaderstats.Money.

0

k ill try it

0

OMG UR THE BEST TYSM