Hello , for my game I really need to make a tool that when clicked , spawns a Model right next to the player (regardless of where the player is on the map , it spawns right next to them). How would I go about doing this? Thank you
If you have the tool, the decal, everything, and you just need the script, you can do the following: You will need a normal script. Put it at the tool. You can type
--Also, I am not scripting you the events when the player clicks with the tool, etc.. plr = script.Parent.Parent.Parent -- script is in the Tool, tool is in Backpack, backpack is in the player (at game.Players.Player) isplayer = workspace:FindFirstChild(plr.Name) if isplayer ~= nil then --Making sure the player's model is in the workspace isplr = isplayer:FindFirstChild("Humanoid") if isplr ~= nil then -- If 'Humanoid' exist: --And there, you can get player's position with the following code: pos = isplr.Torso.Position --isplr.Torso.CFrame is also can be used --And now you just spawn the model at a little bit away from the player. I am not going to script that for you. end end
I hope I didn't made any mistakes, I didn't tested it because I can't script a tool, but I think that it works. You got the player's position, you can now do anything. I hope this is what you wanted.
you can use Clone() and MoveTo() to accomplise this local Model = game:GetService("ServerStorage")
local WorkspaceModel = Model:Clone() WorkspaceModel.Parent = workspace WorkspaceMode:MoveTo(game.Players.Enzo341.Character.HumanoidRootPart.Position + Vector3.new(0,0,-5))