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

Why is this script not seeing the Button that i have inside of it?

Asked by 4 years ago

Im making a tycoon and this button dropper i made was working, i changed the design now the script wont pickup that there is a button in it.

Active = false
if script.Parent.Parent.Parent.Parent.Parent.Parent.Name == workspace then
script.Button.ClickDetector.MouseClick:Connect(function()
    if Active == false then
    NewPart = script.Parent.Part:Clone()
    NewPart.Parent = script.Parent
    NewPart.Transparency = 0
    NewPart.Anchored = false
    NewPart.CanCollide = true
    NewPart.CFrame = script.Parent.CFrame
    NewValue1 = script.Parent.Options.Tycoon:Clone()
    NewValue2 = script.Parent.Options.Value:Clone()
    NewValue1.Parent = NewPart
    NewValue2.Parent = NewPart
    Active = true
    wait(0.5)
    Active = false
    end
end)
end

When that script runs it says this in the output

 19:43:20.356 - Button is not a valid member of Script
19:43:20.357 - Stack Begin
19:43:20.358 - Script 'Workspace.Tycoon1.ClickDropper.Model.ButtonDropper.Part.Script', Line 2
19:43:20.414 - Stack End
0
you dont need to use the code blocks for the output (it looks cooler when you use block quote) speedyfox66 237 — 4y
0
k cameronjamesg2007 7 — 4y
0
Can you tell us the structure of the model? (The parts names in accordance to their hierarchical position) Ziffixture 6913 — 4y
0
nfo: V Part V Script V Button ClickDetector cameronjamesg2007 7 — 4y
View all comments (2 more)
0
@cameronjamesg2007 Its info , not nfo :V Xapelize 2658 — 4y
0
workspace refers to the instance "workspace" not a string so the code presented shouldnt even be running to begin with. Remove the ".Name" then try, but otherwise, this script doesnt appear to be the issue. SerpentineKing 3885 — 4y

Answer this question