Does This Script Work For Driving To Earn Money? Im Not Sure.
local add = 110
01 | script.Parent.Touched:connect( function (hit) |
02 | local character = hit.Parent |
03 | local player = game.Player:GetPlayerFromCharacter(character) |
04 |
05 | if player then |
06 | if script.Parent:FindFirstChild( "SeatWeld" ) then |
07 | script.Parent.sitting.Value = 1 |
08 | wait() |
09 | if script.Parent.Throttle = = 1 then |
10 | wait( 1 ) |
11 | local money = stats:FindFirstChild( "money" ) |
12 | money.Value = money.Value + add |
13 | end |
14 | else |
15 | script.Parent.sitting.Value = 0 |
16 | end |
17 |
18 | end |
19 |
20 | end ) |
I don't know much but I think you need to reference the stats.
01 | local add = 110 |
02 | script.Parent.Touched:connect( function (hit) |
03 | local character = hit.Parent |
04 | local player = game.Player:GetPlayerFromCharacter(character) |
05 | local stats = player.Stats |
06 | if player then |
07 | if script.Parent:FindFirstChild( "SeatWeld" ) then |
08 | script.Parent.sitting.Value = 1 |
09 | wait() |
10 | if script.Parent.Throttle = = 1 then |
11 | wait( 1 ) |
12 | local money = stats:FindFirstChild( "money" ) |
13 | money.Value = money.Value + add |
14 | end |
15 | else |