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

Model spawnclick script?

Asked by 8 years ago

Sorry if i am being a complete noob here but how to i make it when you click a button it spawns a certain model where you click?

0
I will test it. rose4321awesome 0 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago
--In a localscript in the player:

local Plr = game.Players.LocalPlayer
local Mouse = Plr:GetMouse()

local Model = game:GetService("Lighting").Model --Change this

Mouse.Button1Down:connect(function()
    if not pcall(function() local p = Mouse.Target end) then return end --Might stop the output being spammed...
    local NewModel = Model:clone()
    NewModel.Parent = workspace
    NewModel:MoveTo(Mouse.Target.Position)
end)

This might work, not really sure. I've not tested it or anything.

Ad

Answer this question