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

so i was making a tycoon from codakid and when i step on a button it will not work i need help?

Asked by
mqop3434 -64
4 years ago
Edited 4 years ago

so here is the script:

01local button = script.Parent.Button
02 
03function steppedOn(part)
04 
05    local character = part.Parent
06    local player = game.Players:GetPlayerFromCharacter(character)
07    if player and player == script.Parent.Parent.Parent:FindFirstChild('Owner').Value then
08            local moneyAmount = player:FindFirstChild('leaderstats'):FindFirstChild('Cash')
09 
10            if moneyAmount.Value >= script.Parent.Cost.Value then
11 
12            moneyAmount.Value = moneyAmount.Value - script.Parent.Cost.Value
13 
14            for i, child in ipairs(script.Parent.Target.Value:GetChildren()) do
15 
View all 46 lines...
  • there is a target on the object
  • i have a script error that says Workspace.Tycoon.Buttons.BuyDropper2.Script:44: attempt to index nil with 'Button'

1 answer

Log in to vote
0
Answered by
raid6n 2196 Moderation Voter Community Moderator
4 years ago

Maybe try changing the value's name inside of the button.

0
i have it at $25 and on the leaderboard i have $25 mqop3434 -64 — 4y
0
what raid6n 2196 — 4y
0
i changed head on local button = script.Parent.Head to script.Parent.Button and it did not work mqop3434 -64 — 4y
0
line 31 raid6n 2196 — 4y
View all comments (10 more)
0
not 1......................... raid6n 2196 — 4y
0
'Part',script mqop3434 -64 — 4y
0
what should it say? mqop3434 -64 — 4y
0
is it on line 3 or 31 mqop3434 -64 — 4y
0
31 and 32 raid6n 2196 — 4y
0
what should it say? mqop3434 -64 — 4y
0
something instead of value just change thename and edit it raid6n 2196 — 4y
0
what mqop3434 -64 — 4y
0
bye raid6n 2196 — 4y
0
back mqop3434 -64 — 4y
Ad

Answer this question