Gun System not working when I put it in bigger game

Hello, I’ve recently edited already done Gun System, it works fine on a baseplate when I was testing it, but when I put it in my main game which consists a big map, the guns simply wont load.
Here’s an image of what’s happening:
In studio:


In main game:

3 Likes

It might be unions/meshes which may cause performance issues inside the game.

3 Likes

Is StreamingEnabled turned on?

1 Like

Yes. Should I try to lower it? I right now have it on 1524 or something while the default value is 1024

Try disabling it to see if it’s the problem.

1 Like

By what I see in the error the child “Others” is missing which creates an infinite yeld by the :WaitForChild (in simple terms, it waits forever because it can’t find it)

2 Likes

So yes I get it, but its actually in there and also when I test it on baseplate game, it works. When I test it in the game it doesnt.

1 Like

It still doesnt fix the issue.

1 Like

Weird… have you tried restarting roblox studio to see if it isn’t actually the studio?

No, the issue isnt happening in studio, but in the game.

1 Like

Well, you could try using wait(1) on the beggining of the script to give a bit more time to load the important stuff

That’s already implemented in the script.
image

I mean in the beggining, at line 1, this loop only waits for the player’s character

after that it waits 0.5 seconds, and the script works on concept of RemoteEvent, so basically when tool is equipped then the server fires the client and client does its stuff which doesn’t work. As seen in image below.
image

1 Like

Well, the only clear thing, according to it, is that something is missing. If it only occurs in-game then it is related to replication and internet connection, check if it happens with other people

1 Like

Yes it does, as I told before, the game has a big map and a lot of scripts so if that isn’t the reason why it’s not working.

2 Likes

The more stuff the client has to download the slower the game will be 100% loaded which might impact some local scripts, a lot of games use a loading screen to wait for at least a big ammount of the game to be loaded before finally letting the player play. Still, it is good to test it with someone else and see if the error happens to the person too

Yes it does, I’ve tested that.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.