StoryModule 1.0 | Module for roblox's stories

story
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.

TODO: Creating

Poll(Question,TABLE.Buttons)
SetSound(SoundUrlId,Volume)
SetTime(ClockTime,Animate,AnimationTime)

Found a bug?
Hello, If you found a bug you can comment it or private message me, I will try to do my best to fix the bug.

Link:

31 Likes

Nice module! I’ll use it for my games.

3 Likes

This is super cool, nice job! You should add a question dialogue box.

3 Likes

Thabk you!
But what do you mean with *question dialogue box? The module already haves a dialogue box.

1 Like

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()
3 Likes

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.

2 Likes

Thank you! Im working on update 2 to add the settings.

1 Like

I think he means like a poll or something. Like “should we go to the park or the sewer, vote yes or no”.

1 Like

Oh! Okay, doing it, thats a great idea!

1 Like

For what? If I manipulate the camera it will be for the talking.

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

Yes this is exactly what I meant, sorry for being unclear.

1 Like

Hey! While reading this I found an error.

Coutdown(Number,Callback)

2 Likes

Is the video example you provided in the module? If not, please could you send me a file with it on. Thank you!

DEVFORUM CATEGORY UPDATED:
I added a TODO: Creating list in the category, so you will know what I am doing.

May I ask:

  • 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

Maybe a grammar error while coding, now I want to leave like that.

I script like this from my start, I only do that in some cases. Changed for the next update.

It does the same, so I didn’t changed that.

The next update I changed that because I found it… Just wait to update.

The video example is provided in the first post.

Oof, I do not see it? Filler Text.

Search for this text, and you will have a hided section called “Video Example”