ascript.Parent.DialogChoiceSelected:connect(function(player, choice)
if p:GetRankInGroup(2672272) >= 4 then
game.Lighting:findFirstChild(choice.Name) then
game.Lighting:findFirstChild(choice.Name):clone().Parent = workspace
end
end)
end
✓ ANSWER ACCEPTED
Why wont my spawn script Work (It works with dialog s)?
1 answer
✓ Accepted answer
Your error was that there was a random then in line 4, so here is the fixed code:
ascript.Parent.DialogChoiceSelected:connect(function(player, choice)
if p:GetRankInGroup(2672272) >= 4 then
game.Lighting:findFirstChild(choice.Name)
game.Lighting:findFirstChild(choice.Name):clone().Parent = workspace
end
end)
end
ALSO I didn't know if there was a typo in line 1 or if that was the name of the script you were calling on, so here is the fixed fixed code:
script.Parent.DialogChoiceSelected:connect(function(player, choice)
if p:GetRankInGroup(2672272) >= 4 then
game.Lighting:findFirstChild(choice.Name)
game.Lighting:findFirstChild(choice.Name):clone().Parent = workspace
end
end)
end
1 comment
0
ascript is a mistake since in order to call on the script that has the code in it, it should be named script. If you name a script "MainCode" you still address it by "script", not "MainCode.Parent".
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Is there any output? Also I noticed that there is a random "then" on line three but no if or end?
typo you put ascript.parent