DriFtyZ Posted May 19, 2017 Share Posted May 19, 2017 hello community i started making a car shop scripting where when a player hits a marker it opens up a gui menu where he can select which he wants to buy, BUT when he selects a specific car on the list i made it to spawn inside the carshop to see how it look like is(preview car)... the thing is the vehicle that is created is not locally which means all the players can see it any ideas how to create and remove elements only for localPlayer? Link to comment
pa3ck Posted May 19, 2017 Share Posted May 19, 2017 You probably have something like this (if it's a client-only script, as it should be): local marker = createMaker(...) addEventHandler("onClientMarkerHit", marker, function() guiSetVisible(....) createVehicle(....) end) Change it to this: local marker = createMaker(...) addEventHandler("onClientMarkerHit", marker, function(player, dim) if player == localPlayer and dim then guiSetVisible(....) createVehicle(....) end end) If it doesn't look like that and you trigger an event from the server-side, show us your code. Link to comment
DriFtyZ Posted May 20, 2017 Author Share Posted May 20, 2017 sorry, i have been little busy last day it wasn't server side script and i fixed it with your example, thanks Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now