Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Uncertain of the error here? (UNSOLVED)

Asked by 10 years ago

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

01local player = game.Players.LocalPlayer --You are using a local script so you can use LocalPlayer.
02 
03script.Parent.MouseButton1Down:connect(function()
04 
05                             script.Parent.Parent.Visible = false
06 
07 tutorial = Instance.new("Part",workspace)
08 
09tutorial.Name = "tutorial"
10 
11tutorial.CFrame = CFrame.new(Vector3.new(3.301, 0.7, 36.088))
12 
13    local g = Instance.new("Hint", workspace)
14wait(.3)
15g.Text = player.Name..", Step on the gray square to begin tutorial!"
View all 34 lines...

3 answers

Log in to vote
0
Answered by
Dr_Doge 100
10 years ago

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.

0
I had lighting before. It made no effect. Also, I see what you mean about the variable mix up, since i later in the same line use :Clone(). Thanks, I haven't noticed that! SmokeyIsSmoking 0 — 10y
Ad
Log in to vote
0
Answered by
Diitto 230 Moderation Voter
10 years ago

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().

0
Okay thanks. I was previously told that I should use ServerStorage. I'll try it though! :-) SmokeyIsSmoking 0 — 10y
Log in to vote
0
Answered by 10 years ago

try this

01local player = game.Players.LocalPlayer --You are using a local script so you can use LocalPlayer.
02 
03script.Parent.MouseButton1Down:connect(function()
04 
05                             script.Parent.Parent.Visible = false
06 
07 tutorial = Instance.new("Part")
08 
09tutorial.Parent = game.Workspace
10 
11tutorial.Name = "tutorial"
12 
13tutorial.CFrame = CFrame.new(Vector3.new(3.301, 0.7, 36.088))
14 
15    local g = Instance.new("Hint",player.PlayerGui)
View all 36 lines...

if it doesn't work tell me C:

Answer this question