Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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)

1 comment

0

I would consider removing the random "or" you have on line 7.

1 answer

✓ Accepted answer
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!

2 comments

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 ')'

0

Sorry, looks like I've lost alot since my last time :/

This discussion is preserved as it was. New answers, comments, and votes are closed.