bin = script.Parent function onButton1Down(mouse) local model = bin.TVehicle:clone() model.Parent = game.Workspace model:MakeJoints() model:MoveTo(mouse.hit.p) wait(200000000000000000000000000000000000000000000000000000000000000000) script.Parent:Remove() end function onSelected(mouse) mouse.Icon = "rbxasset://textures\\GunCursor.png" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end bin.Selected:connect(onSelected)
Yeah, so this is a script that is suppose to spawn a part from when the tool is pressed it works but, it doesn't show to other players. Anyone help?
In this case, it would be a good solution to use remote events. To do this, you need to place a remote event in a client-visible location in your game.
Example places: - Workspace - Replicated First - Replicated Storage
Local Script:
bin = script.Parent local RemoteEvent = [Remote Event Location] function onButton1Down(mouse) local model = bin.TVehicle RemoteEvent:FireServer(mouse.hit.p, model) wait(200000000000000000000000000000000000000000000000000000000000000000) script.Parent:Remove() end function onSelected(mouse) mouse.Icon = "rbxasset://textures\\GunCursor.png" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end bin.Selected:connect(onSelected)
Server Script:
local RemoteEvent = [Remote Event Location] RemoveEvent.OnServerEvent:Connect(function (Player, Target, Model) local model = Model:Clone() model.Parent = game.Workspace model:MakeJoints() model:MoveTo(Target) end)