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

I'm trying to make the local script randomly choose between 2 Frames but somehow it doesnt work?

Asked by 4 years ago
script.Parent.MouseButton1Click:Connect(function()
    script.Parent.Parent:TweenPosition(UDim2.new(-1, 0,0.258, 0))
    wait(1)
    script.Parent.Parent.Visible = false
    local Quest = script.Parent.Parent.Parent.Quest
    Quest.Visible = true
    or wait(1)
    script.Parent.Parent.Visible = false
    local Quest1 = script.Parent.Parent.Parent.Quest
    Quest1.Visible = true


end)

0
I would consider removing the random "or" you have on line 7. Unhumanly 152 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
local Quest = script.Parent.Parent.Parent.Quest
local Quest1 = script.Parent.Parent.Parent.Quest
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent:TweenPosition(UDim2.new(-1,0,0.258,0))
choices = math.random(1,2)
if choices == 1 then Quest.Visible = true
elseif choices == 2 then Quest1.Visible = true

end)

Please, do let me know if this does not work! I have not scripted on ROBLOX since February 2019 and I really need to know what I still do and don't know!

0
Well no it did not work and only gave me an error which said: Players.Simpletton.PlayerGui.Quest.Frame.TextButton.LocalScript:9: unexpected symbol near ')' Simpletton 82 — 4y
0
Sorry, looks like I've lost alot since my last time :/ Sk3pticalR0BL0X 33 — 4y
Ad

Answer this question