Hello, People!
I recently started making ‘Story Games’, so I decided to make a StoryModule.
It is free of use, you don’t need to credit me, but it would be apreciated.
You can see documentation by clicking on the top image.
These are the actual features.
You can also give me features ideas.
Actual Features
The actual features are: MakeDialog(string) NPCDialog(ImageURL,StringMsg,Model.Character) HideDialog() Countdown(Number,Callback) BreakCount(Callback) – must be called from a different script that the countdown start teleport(Instance.Part)
Here are some things that you can make with this module:
This is a quick and fast example.
Video Example
Thank you!
This is a TODO List, there are the things that I am creating right now.
You should add a camera manipulation where it tweens the camera lets say 5-10 studs in front of the character’s head. You could do this by:
local TS = game:GetService("TweenService")
local Pos = Character.Head.Position + Vector3.new(0,0,-5) -- I THINK but I'm not sure since I'm not the best with CFrames
TS:Create(workspace.CurrentCamera, TweenInfo.new(1), {Position = Pos}):Play()
That’s pretty cool, I would personally have an option to disable text scaling and maybe more UI options overall though as I feel it can look a little janky when there’s a lot of dialogue and the text gradually shrinks.
Half Update Done
Now, when you stop the timer you can add a callback, using BreakTimer(function() print('callback!') end)
I’ll add it into documentation tomorrow.
If you still haven’t seen documentation yet, click on the top image, or click here: documentation
Why are the teleport function in lowercase but the others are in Pascal Case?
From the ModuleScript StoryModule
Why not not cancelled instead of cancelled == false? Why not ReplicatedStorage.StoryModuleRemotes instead of ReplicatedStorage["StoryModuleRemotes"]?
function story.Countdown(secs,callback)
canceled = false
game.ReplicatedStorage["StoryModuleRemotes"].startCount:FireAllClients(secs)
wait(secs)
if canceled == false then
callback()
end
end
And why not game:GetService("ReplicatedStorage") instead of game.ReplicatedStorage?
From StartGui/MainGui/Current
a.startCount.OnClientEvent:Connect(function(secs)
script.Canceled.Value = false
local t = secs
script.Parent.Countdown.Visible = true
script.Parent.Countdown.Count.Text = tostring(t)
while wait(1) do
if script.Canceled.Value == true then
script.Parent.Countdown.Visible = false
break
else
t -= 1
script.Parent.Countdown.Count.Text = tostring(t)
if t <= 0 then
script.Parent.Countdown.Visible = false
break
end
end
end
end)
First, why tostring on a number as numbers and strings are automatically converted when doing mostly anything with them?
Secondly, why not for loops?
Thridly why not set the CountdownValue.Visible to false after the for loop as it looks like both break have it.
function show(fr)
local fade = tweenService:Create(fr, TweenInfo.new(0.4,Enum.EasingStyle.Cubic), {Size = fr.Size, Position = UDim2.new(0.5, 0,0.15, 0)})
fade:Play()
wait(fade.TweenInfo.Time)
end
function hide(fr)
local fade = tweenService:Create(fr, TweenInfo.new(0.4,Enum.EasingStyle.Cubic), {Size = fr.Size, Position = UDim2.new(0.5, 0,-1, 0)})
fade:Play()
wait(fade.TweenInfo.Time)
end
Why wait instead of fade.Completed:Wait()?
I noticed you’re using wait, you should avoid using them