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

Unable to make a tutorial, nothing is happening, how do i fix this?

Asked by
Komas19 34
2 years ago
Edited 2 years ago

ok so, im trying to make a tutorial for my game that is releasing August 1st, but i have a problem, my localscript doesn't work and no errors are going to the output

Code (LocalScript)

local place = game:GetService("Players").LocalPlayer.IsTutorialFinished
local textplace = script.Parent.Text.Text
local button = script.Parent.OK.MouseButton1Click
local sound = script.Parent["OK.last"].ding
local button1 = script.Parent["OK.last"].Visible
local button2 = script.Parent.OK.Visible
local message1 = "Welcome to "..game.Name.." ! This is the tutorial which will help you to play the game! Press Ok to continue, press X to not read it."
local message2 = "Touch a PC to pick it up! Then press OK to continue."
local message3 = "After that, you can press the???? button at the top left! After that, press OK to continue."
local message4 = "Now, you can go to the SELL building, or you can click the ???? Sell button at the top left! Then touch the building, then press OK to continue."
local message5 = "Press the ?????????? button at the top left to upgrade your pc space! Then click 'Upgrade to maximum possible pc space with that amount of money', and that will make you have more pc space! Press OK to continue."
local message6 = "Thats pretty much it, you can press the ???? button at the top left to have more stuff. Gamepasses are permanent and one time use only, products are temporary and can use it an infinite amount of time. Press finish to finish the tutorial."

while wait() do
    if place.Value == false then
        textplace = message1
        button:Connect(function()
            sound:Play()
            if textplace == message1 then
                textplace = message2
            end
            if textplace == message2 then
                textplace = message3
            end
            if textplace == message3 then
                textplace = message4
            end
            if textplace == message4 then
                textplace = message5
            end
            if textplace == message5 then
                textplace = message6
                button1 = true
                button2 = false
            end
        end)
    end
end

the question marks at the messages are emojis in my game.

0
You called the TextLabel Text which is it's property then the script gets confused, MAybe change the TextLabels name MattVSNNL 620 — 2y

2 answers

Log in to vote
1
Answered by
ryanzhzh 128
2 years ago
Edited 2 years ago

I'll try. Putting local var = script.Parent.Text and var = message1 doesn't work because it returns a string being a property, for example if the text was "put text here" then it returns "put text here". So it might be hard but var (script.Parent.Text) = message2 is changing a variable, not the text. ---------------------- extra ------------- You can use print(script.Parent.Text, textplace) to check if you are changing the variable. - Output for extra - text, Touch a PC to pick it up! Then press ok to continue

local place = game:GetService("Players").LocalPlayer.IsTutorialFinished
local textplace = script.Parent -- button place, no [button path].Text!
local button = script.Parent.OK.MouseButton1Click
local sound = script.Parent["OK.last"].ding
local button1 = script.Parent["OK.last"].Visible
local button2 = script.Parent.OK.Visible
local message1 = "Welcome to "..game.Name.." ! This is the tutorial which will help you to play the game! Press Ok to continue, press X to not read it."

local message2 = "Touch a PC to pick it up! Then press OK to continue."

local message3 = "After that, you can press the???? button at the top left! After that, press OK to continue."

local message4 = "Now, you can go to the SELL building, or you can click the ???? Sell button at the top left! Then touch the building, then press OK to continue."

local message5 = "Press the ?????????? button at the top left to upgrade your pc space! Then click 'Upgrade to maximum possible pc space with that amount of money', and that will make you have more pc space! Press OK to continue."

local message6 = "Thats pretty much it, you can press the ???? button at the top left to have more stuff. Gamepasses are permanent and one time use only, products are temporary and can use it an infinite amount of time. Press finish to finish the tutorial."

while wait() do
    if place.Value == false then
        textplace = message1
        button:Connect(function()
            sound:Play()
            if textplace.Text == message1 then
                textplace.Text = message2
            end
            if textplace.Text == message2 then
                textplace.Text = message3
            end
            if textplace.Text == message3 then
                textplace.Text = message4
            end
            if textplace.Text == message4 then
                textplace.Text = message5
            end
            if textplace.Text == message5 then
                textplace.Text = message6
                button1 = true
                button2 = false
            end
        end)
    end
end
0
You should organize object names a little better ryanzhzh 128 — 2y
Ad
Log in to vote
0
Answered by
enes223 327 Moderation Voter
2 years ago

hey you! have you ever heard of enes? if you are in trouble, better call enes!

0
dude ryanzhzh 128 — 2y

Answer this question