so here is the script:
local button = script.Parent.Button
function steppedOn(part)
local character = part.Parent
local player = game.Players:GetPlayerFromCharacter(character)
if player and player == script.Parent.Parent.Parent:FindFirstChild('Owner').Value then
local moneyAmount = player:FindFirstChild('leaderstats'):FindFirstChild('Cash')
if moneyAmount.Value >= script.Parent.Cost.Value then
moneyAmount.Value = moneyAmount.Value - script.Parent.Cost.Value
for i, child in ipairs(script.Parent.Target.Value:GetChildren()) do
if child.ClassName == 'Part' then
child.Transparency = 0
if child.Name ~= 'DropLocation' then
child.CanCollide = true
end
end
end
if script.Parent.Target.Value:FindFirstChild('Activated') then
script.Parent.Target.Activated.Value = true
end
for i, button in ipairs(script.Parent.Unlocks:GetChildren()) do
button.Value.Button.Transparency = 0
button.Value.Button.CanCollide = true
end
script.Parent:Destroy()
end
end
end
button.Touched:Connect(steppedOn)
for i, button in ipairs(script.Parent.Unlocks:GetChildren()) do
button.Value.Button.Transparency = 1
button.Value.Button.CanCollide = false
end
- 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'

14 comments
i have it at $25 and on the leaderboard i have $25
what
i changed head on local button = script.Parent.Head to script.Parent.Button and it did not work
line 31
not 1.........................
'Part',script
what should it say?
is it on line 3 or 31
31 and 32
what should it say?
something instead of value just change thename and edit it
what
bye
back