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

Why wont my spawn script Work (It works with dialog s)?

Asked by 8 years ago
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
0
Is there any output? Also I noticed that there is a random "then" on line three but no if or end? VariadicFunction 335 — 8y
0
typo you put ascript.parent duckyo011 36 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

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

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". EzraNehemiah_TF2 3552 — 8y
Ad

Answer this question