I'm new to scripting, and I have no clue how to start this..
So, first you should have the model you want to clone inside of game.ReplicatedStorage. Don't use lighting, since that isn't meant for storing stuff, obviously. You also shouldn't use ServerStorage, since we're going to be coding in a localscript.
First, create a "RemoteEvent" and put it in ReplicatedStorage. RemoteEvent is what's used to have the server communicate with the client. (and vise versa)
Next, put this in a ServerScript inside ServerScriptService (Never put normal scripts in workspace)
local model = game.ReplicatedStorage.name -- Change name to the model's name, please note that it can't have spaces in it. function spawnModelForPlr(plr) local character = plr.Character local newModel = model:Clone() newModel.Parent = game.Workspace newModel:MoveTo((character.Head.CFrame * CFrame.new(0, 0, -10)).p) -- this moves it 10 studs infront of the player. end game.ReplicatedStorage.RemoteEvent.OnServerEvent:connect(spawnModelForPlr)
Next, put a LocalScript inside of the TextButton you've created. Inside it, have this code:
local button = script.Parent -- if the script isn't inside of the textbutton, change the directory here button.MouseButton1Click:connect(function() game.ReplicatedStorage.RemoteEvent:FireServer() end)
Well Here Is What You Want To Do:
script.Parent.MouseButton1Click:connect(function() local Part = Instance.new("Part") Part.Position = 0, 0, 0 Part.Color = 255,255,255 Part.Refletance = 2 Part.CanColide = false
Keep Repeating It With Different Part Names At Local
Instead Of Part Next Time Do Part2,Part3 etc. Make Sure This Is In a Local Script In The Image Button.