I've tried running this through output and stuff, and it's not helpful to me.
I'm having troubles getting a model to clone from server storage after a player steps on a brick that was created in Workspace through Instance.new
.
The script is:
In a local script > Inside of a button > Inside of a Frame > Inside a GUI
01 | local player = game.Players.LocalPlayer --You are using a local script so you can use LocalPlayer. |
02 |
03 | script.Parent.MouseButton 1 Down:connect( function () |
04 |
05 | script.Parent.Parent.Visible = false |
06 |
07 | tutorial = Instance.new( "Part" ,workspace) |
08 |
09 | tutorial.Name = "tutorial" |
10 |
11 | tutorial.CFrame = CFrame.new(Vector 3. new( 3.301 , 0.7 , 36.088 )) |
12 |
13 | local g = Instance.new( "Hint" , workspace) |
14 | wait(. 3 ) |
15 | g.Text = player.Name.. ", Step on the gray square to begin tutorial!" |
Try changing the variable "clone" to something like "pie" and try using game.workspace in replace of workspace in line 29.
Also I like to use game.lighting when it comes to storage places. I remember using ServerStorage once and it didt work.
I might be wrong, but this is my best answer.
You cannot access ServerStorage from a LocalScript, for the purpose of ServerStorage is to prevent objects from replicating to the client.
If you want to use a storage( don't use Lighting, strongly unadvised ), use ReplicatedStorage. It's meant to replicate, and was made as a replacement for Lighting, which was used improperly.
Just move the object in Studio, and change the code from
local clone = game.ServerStorage.Sofa:Clone()
to
local clone = Game.ReplicatedStorage.Sofa:Clone()
.
try this
01 | local player = game.Players.LocalPlayer --You are using a local script so you can use LocalPlayer. |
02 |
03 | script.Parent.MouseButton 1 Down:connect( function () |
04 |
05 | script.Parent.Parent.Visible = false |
06 |
07 | tutorial = Instance.new( "Part" ) |
08 |
09 | tutorial.Parent = game.Workspace |
10 |
11 | tutorial.Name = "tutorial" |
12 |
13 | tutorial.CFrame = CFrame.new(Vector 3. new( 3.301 , 0.7 , 36.088 )) |
14 |
15 | local g = Instance.new( "Hint" ,player.PlayerGui) |
if it doesn't work tell me C: