Skip to content

Feat: Allow requiring zap from edit mode (for Storyboards)#218

Merged
sasial-dev merged 3 commits into
red-blox:0.6.xfrom
EstebenR:patch-1
May 2, 2026
Merged

Feat: Allow requiring zap from edit mode (for Storyboards)#218
sasial-dev merged 3 commits into
red-blox:0.6.xfrom
EstebenR:patch-1

Conversation

@EstebenR

Copy link
Copy Markdown
Contributor

Studio will return true for RunService:IsServer() in edit mode. For testing components using storyboards, any component that requires the client network module will error.

This fix makes it so Zap is allowed to be required while in edit mode even if IsServer returns true

Studio will return true for RunService:IsServer() in edit mode. For testing components using storyboards, any component that requires the client network module will error.

This fix makes it so Zap is allowed to be required while in edit mode even if IsServer returns true
@Ezzenix

Ezzenix commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

IsEdit has plugin security it will error when playing.

@EstebenR

Copy link
Copy Markdown
Contributor Author

IsEdit has plugin security it will error when playing.

Error how? I currently have this change live in my games and there's no issue

@Ezzenix

Ezzenix commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Then you are not requiring from the server in your live game. Since RunService:IsServer() is false the RunService:IsEdit() never runs for you.

@EstebenR

Copy link
Copy Markdown
Contributor Author

Working as intended then? If ClientNetwork were to be required from the server in live it should error anyways, shouldn't it?
I guess we could wrap it in a pcall in that case so that the error is descriptive... What do you suggest?

@Ezzenix

Ezzenix commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Calling IsEdit() outside of a plugin will give this error
"The current thread cannot call 'IsEdit' (lacking capability Plugin)"

I think what you want is

if RunService:IsServer() and RunService:IsRunning() then
	error("Cannot use the client module on the server!")
end

@EstebenR

Copy link
Copy Markdown
Contributor Author

Yep you're right. I've tested it and it works for storyboards :D

@sasial-dev sasial-dev merged commit d4481d3 into red-blox:0.6.x May 2, 2026
2 checks passed
@sasial-dev

Copy link
Copy Markdown
Collaborator

Realised I forgot to hit approve - but thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants