Skip to content

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

Open
EstebenR wants to merge 2 commits intored-blox:0.6.xfrom
EstebenR:patch-1
Open

Feat: Allow requiring zap from edit mode (for Storyboards)#218
EstebenR wants to merge 2 commits intored-blox:0.6.xfrom
EstebenR:patch-1

Conversation

@EstebenR
Copy link
Copy Markdown

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
Copy link
Copy Markdown
Contributor

Ezzenix commented Mar 23, 2026

IsEdit has plugin security it will error when playing.

@EstebenR
Copy link
Copy Markdown
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
Copy link
Copy Markdown
Contributor

Ezzenix commented Mar 23, 2026

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
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
Copy link
Copy Markdown
Contributor

Ezzenix commented Mar 24, 2026

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
Author

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

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.

2 participants