Sign in to follow this  
Et-win

getResourceFromName client-side

Recommended Posts

outputChatBox(tostring(getResourceFromName("race"))) 

This always returns 'false' in client-side, I'm wondering why? (Server-side works only)

EDIT: If I use

outputChatBox(tostring(getResourceFromName("admin"))) 

it works fine. Why doesn't this work with "race"?

Share this post


Link to post

I found out that the resource needs to be running when using 'getResourceFromName'.

So I have an editbox and can fill in any name and want to check if it exists. How can I do this when I can't use 'getResourceFromName' when the resource is not running?

Share this post


Link to post

I guess you'd most likley have to do some server-client events (preferably latent events, so the server wouldn't lag)

Share this post


Link to post

just like you can't get a player from getPlayerFromName while he/she is offline, you can't get a resource with getResourceFromName if it's not running.

you can use serverside and use getResources() and check if it exists server-side

if you insist on client-side then idk, i didn't really use this client-sided nor i needed to

Share this post


Link to post
you can't get a resource with getResourceFromName if it's not running.

Server-side you can, so I don't see the reason for not being able to do it client-side.

Share this post


Link to post

I guess it's because the client is not aware of all resources; only those which are running, have an instance, have their resourceRoot element are visible to the client.

Share this post


Link to post

Well anyway, I did a trigger to server-side and back to client-side to check or the resource exists. Thanks all for the thinking (and helping).

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.