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

My intro wont work!

Asked by 10 years ago

HERE IS MY SCRIPT!

 wait (2)
 for i = 1, 10 do
    trans = 1/10
    trans = 1 - trans
    script.Parent.BG.BackgroundTransparency = trans
    wait (.1)
 end

 script.Parent.BG.Text1.Text = "Welcome to the town of Rosedale!"
 wait (3)
 script.Parent.BG.Text2.Text = "I am your real estate agent, Amy"
 wait (3)
 script.Parent.BG.Text3.Text = "I will also show you around town!"
 wait (3)
 script.Parent.BG.Text4.Text = "chat ok to begin playing!"
 script.Parent.Parent.Parent.Chatted:connect(function(msg)
    if script ~= nil then
    message = msg:lower()
    if message == "ok" then
    script.Parent.BG.Text1.Text = "Here is where all the stores are,"
    wait (5)
    script.Parent.BG.Text2.Text = "Now here, is the park."
    wait (5)
    script.Parent.BG.Text3.Text = "And here, is the school."
    wait (5)
    script.Parent.BG.Text4.Text = "And most important, here are all the houses."
    wait (.2)
    for i = 1, 10 do
    trans = 1/10
    script.Parent.BG.BackgroundTransparency = trans
    wait (.1)
    end
    x = Instance.new("IntValue" , script.Parent.Parent.Parent)
    x.Name = "WentThroughCutscene"
    script.Parent:remove()
    end
   end
   end)

Once you chat ok, more text is supposed to pop up and its supposed to turn into a cutscene, But it wont work.

0
Sorry XD i don't really know how to like paste scripts onto this. BreBreGaming 10 — 10y
0
Edit this then select the code then click on the icon at the very right DragonSkyye 517 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago

Here's the script in a code block.

I'll assume you declared all the variables. All edits are commented on in the script. I hope this helps.

wait (2)
--[[for i = 1, 10 do        this is the old loop
    trans = 1/10
    trans = 1 - trans
    script.Parent.BG.BackgroundTransparency = trans
    wait (.1)
end
--]]

for i = 10, 0, -.1      --My version of the loop
    trans = i/10
    script.Parent.BG.BackgroundTransparency = trans
    wait()
end

--[[        script.Parent.BG.Text1.Text = "Welcome to the town of Rosedale!"
        wait (3)                original text   updated version does not affect script performance
        script.Parent.BG.Text2.Text = "I am your real estate agent, Amy"
        wait (3)
        script.Parent.BG.Text3.Text = "I will also show you around town!"
        wait (3)
        script.Parent.BG.Text4.Text = "chat ok to begin playing!"--]]

script.Parent.BG.Text1.Text = "Welcome to the town of Rosedale!" --A scroll print function might look nice with this text. I think it's a better transition, but it's purely aesthetic.
wait (.5)               --updated version
script.Parent.BG.Text2.Text = "I am your real estate agent, Amy, and I'll show you around town when you're ready"
wait (.5)
script.Parent.BG.Text4.Text = "chat ok to begin playing!"

script.Parent.Parent.Parent.Chatted:connect(function(msg)
    if script ~= nil then --I don't know if this needs to be script.parent or if it's good as is. Would hurt to look into that
        message = msg:lower()
        if message == "ok" then

            --[[script.Parent.BG.Text1.Text = "Here is where all the stores are,"   original version
            wait (5)
            script.Parent.BG.Text2.Text = "Now here, is the park."
            wait (5)
            script.Parent.BG.Text3.Text = "And here, is the school."
            wait (5)
            script.Parent.BG.Text4.Text = "And most important, here are all the houses."
            wait (.2)--]]

            script.Parent.BG.Text1.Text = "All the stores in town are located here." --updated version
            wait (3)            --You can alter the extra statements to go along with what the places look like in game.
            script.Parent.BG.Text2.Text = "The park is here. Nice location, don't you think?"
            wait (3)
            script.Parent.BG.Text3.Text = "Here is the school. It's one of the best buildings around."
            wait (3)
            script.Parent.BG.Text4.Text = "Finally, the most important buildings in town, the houses"
            wait (.2)

            for i = 0, 10, .1 do
                trans = i/10 
                script.Parent.BG.BackgroundTransparency = trans
                wait ()
            end
            x = Instance.new("IntValue" , script.Parent.Parent.Parent)
            x.Name = "WentThroughCutscene"
            script.Parent:remove()
        end
    end
end)
Ad
Log in to vote
0
Answered by 10 years ago

This is the script you asked for on ROBLOX from "The Football Coach"....It'll take lots of editing to match your game set but have fun!

----------------------
---define variables---
----------------------
local animating=true;--is an animation running?
local playa=game.Players.LocalPlayer;--the player
local camera=workspace.CurrentCamera;--the players camera
local stage=game.Lighting.Entrance:clone();--the place where everything will be acted out
local nodes=stage.Nodes;--the walking points for AI's
local cameras=stage.Cameras;--the camera positions to transition through
local current_camera=0;--the current camera position the player is on
local AIChat=playa.PlayerGui.AIChat;--the GUI chat for when an AI is talking
local blackout=playa.PlayerGui.Blackout;--the black screen for fading to a new scene
local red_spawn=stage.RDoor;--red door to spawn characters out of
local blue_spawn=stage.BDoor;--blue door to spawn characters out of
local follow=false;--keep following target?
---the characters---
local assistant=game.Lighting.Assistant;
local scout=game.Lighting.Scout;
local QB=game.Lighting["QB Coach"];
local LB=game.Lighting["LB Coach"];
local WR=game.Lighting["WR Coach"];
local DB=game.Lighting["DB Coach"];
---talk colors---
local desk=BrickColor.new("Bright violet");
local assistantC=BrickColor.new("Dark green");
local scoutC=BrickColor.new("Navy blue");
local count=1;--the position in the players this player is
for i,v in pairs(workspace:GetChildren()) do
    if v.Name=="Entrance" then
        count=i;
end end

----------------------
---define functions---
----------------------

camera.Changed:connect(function()
    camera.CameraType="Scriptable";
end
);

--displays a message in the chat bar
function message(msg,color,time)
    AIChat.Text.Visible=true;
    AIChat.Text.Text=msg;
    AIChat.Text.BackgroundColor=color or BrickColor.new("Really black");
    Wait(time or 5);
    AIChat.Text.Visible=false;
end

--moves to the next camera
function nextCam(frames,start_delay,frame_speed)
    local frames=frames or 50;
    camera.CameraType="Scriptable";
    local start= camera.CoordinateFrame;--the camera to start at
    current_camera=current_camera+1;
    local finish=cameras["Cam"..current_camera];--the camera to finish at
    if start_delay then 
        Wait(start_delay);
    end
    for i=0,1,1/frames do
        local pos=start.p:Lerp(finish.Position,i);--the position
        --local rot=start.Rotation:Lerp(finish.Rotation,i);--the rotation
        local look=start.lookVector:Lerp(finish.CFrame.lookVector,i);--the lookVector of the object
        camera.CoordinateFrame=CFrame.new(pos,pos+Vector3.new(look.x,0,look.z));
        Wait(frame_speed or 0.03);
    end
end

--fades out to a new camera position
function fadeOut(cam)
    current_camera=cam;
    camera.CameraType="Scriptable";
    for i=1,0,-0.05 do
        blackout.Frame.BackgroundTransparency=i;
        Wait();
    end
    local pos=cameras["Cam"..current_camera].Position;
    local look=cameras["Cam"..current_camera].CFrame.lookVector;
    camera.CoordinateFrame=CFrame.new(pos,pos+Vector3.new(look.x,0,look.z));
    for i=0,1,0.05 do
        blackout.Frame.BackgroundTransparency=i;
        Wait();
end end

--spawns a character
function SpawnC(mod,spawn)
    local char=mod:clone();
    char.Name="";
    char.Parent=stage;
    --char:MakeJoints();
    Wait();
    char:MoveTo(spawn.Position);
    return char;
end

--follows a part until 'follow' becomes false
function followP(part)
    follow=true;
    camera.CameraType="Scriptable";
    Spawn(function()
    while follow do
        camera.CoordinateFrame=CFrame.new(camera.CoordinateFrame.p,Vector3.new(part.CFrame.x,camera.CoordinateFrame.p.y,part.CFrame.z));
        Wait();
    end end
    );
end

--moves a character to a certain node
function move(char,node)
    local node=stage.Nodes["Node"..node];
    if math.abs(char.Torso.Position.x-node.Position.x)+math.abs(char.Torso.Position.z-node.Position.z)<=3 then
        return false;
    else
        char.Humanoid:MoveTo(node.Position,stage.Base);
        return true;
end end

--------------
---run code---
--------------

--parent the stage to the players camera
stage.Parent=workspace;
stage:MoveTo(Vector3.new(count*200,count*200,0));
stage:MakeJoints();
playa.Scene.Value=stage;
--begin animation
fadeOut(0);--fade to start
nextCam();--walk to front desk
Wait(1);
message("Amy: Hi there! You must be "..playa.Name.."! We have been expecting you.",desk);
message("Amy: My name is Amy and I am with the Football Legends Association. It says here that you signed up to become a coach 4 days ago.",desk,8);
message("Amy: Well let me first explain how things work here.",desk,3);
message("Amy: In the FBLA there are three different ways to get games for your team: quick games, tournaments and leagues.",desk,6);
message("Amy: Quick games are whenever one team challenges another and then they play at the field of the team that gave the challenge.",desk,7);
message("Amy: Tournaments are all single-elimination brackets where multiple teams are entered. And once you lose, you're out.",desk,6);
message("Amy: Leagues are groups of teams that will play every team within the league.",desk,5);
message("Amy: At the end of the season, teams will be paired up based on their record in the league for one last game to decide the final rankings of the league.",desk,7);
message("Amy: In the FBLA games are played with 5 players on each side of the ball.",desk,3);
message("Amy: As the coach you can decide the formation and play call however other additional rules are decided by the league and/or host team.",desk,7);
message("Amy: Anyways I hope that is easy enough to understand.",desk,3);
message("Amy: Your assistant coach and scout should be coming soon. Oh look! Here they are.",desk,3);
--spawn the assistant
local assis0=SpawnC(assistant,red_spawn);
followP(assis0.Torso);
Spawn(function()
    while move(assis0,0) do
        Wait();
    end
    while move(assis0,1) do
        Wait();
    end
end
);
Wait(1);
--spawn scout
local scout0=SpawnC(scout,red_spawn);
while move(scout0,0) do
    Wait();
end
while move(scout0,2) do
    Wait();
    print(2);
end
nextCam();--face assistant
message("Assistant: Hello "..playa.Name.." I am your assistant coach for FBLA.",assistantC,3);
message("Assistant: It is my job to help you with, well, basically everything.",assistantC,4);
message("Assistant: But first order of business, we need players. Our scout here will help us find those.",assistantC);
message("Assistant: I wish I could stay and talk longer, but there is a lot to do!",assistantC,4);
message("Assistant: While you talk to him about getting new players, I have to go and get us some position coaches. See you soon!",assistantC);
--graciously exit
while move(assis0,3) do
    Wait();
end
while move(assis0,4) do
    Wait();
end
follow=false;
Spawn(function()
    while move(assis0,5) do
        Wait();
    end
    assis0:Destroy();
end);
nextCam();
message("Scout: Hey "..playa.Name..", I am your teams scout. This means I go out to look for players.",scoutC);
message("Scout: Since we are a brand new team looks like I have a lot of work to do.",scoutC,4);
message("Scout: To get the proper guys for our team, I am going to need your preference.",scoutC,4);
message("Scout: Please fill this out completely...",scoutC,2.5);
playa.PlayerGui.ScoutSheet.Border.Visible=true;
repeat Wait(); until not playa.PlayerGui.ScoutSheet.Border.Visible
message("Scout: Great, thanks! I will get on it right now!",scoutC,3);
followP(scout0.Torso);
while move(scout0,3) do
    Wait();
end
while move(scout0,4) do
    Wait();
end
follow=false;
nextCam();
Spawn(function()
    while move(scout0,5) do
        Wait();
    end
    scout0:Destroy();
end
);
message("Amy: Okay now "..playa.Name..", Let me make a few changes in you Info",desk,7);
message("Amy: Ok, "..playa.Name..", I'll send him the new information ....",desk,7);

Answer this question