Basically my game has FilteringEnabled on (have not used this before) and I need to show a model only to the player when they join...
I've come up with this in a local script, inside *StarterPlayerScripts * under StarterPack. It works in normal studio test mode yet when I start a Test Server only the player's name is printed and nothing gets moved....
1 | local player = game.Players.LocalPlayer |
2 |
3 | if player.Name = = "Player1" or player.Name = = "Player" then |
4 | print (player.Name) |
5 | local clone = game.ServerStorage.ShipModel:Clone() |
6 | clone.Parent = game.Workspace |
7 | print ( "Cloned and moved" ) |
8 | end |
Any help is appreciated, thanks :)
This is because local scripts cannot access game.ServerStorage
For more information on LocalScripts please visit this link.
So if you want the model to only be viewed by the player them selves. im sure you can do that with FE, but your better off putting it in the players camera by doing the following:
1 | local player = game.Players.LocalPlayer |
2 | if player.Name = = "Player1" or player.Name = = "Player" then |
3 | print (player.Name) |
4 | game.ReplicatedStorage.ShipModel:Clone().Parent = game.Workspace.CurrentCamera |
5 | print ( "Cloned and moved" ) |
6 | end |
You should have used Replicated storage, you used server storage
1 | local clone = game.ServerStorage.ShipModel:Clone() |
And camera is a good way to keep things local.