So when you select the tool, and you click, it suppose to spawn a noob where you clicked but ofc it isnt working..
code:
Player = game.Players.LocalPlayer Mouse = Player:GetMouse() Spawner = game.StarterPack.Spawner Mouse.Button1Down:connect(function() if Spawner.Equipped == true then local noob = game.ReplicatedStorage.Noob:Clone() noob.Parent = game.workspace noob:MoveTo(Mouse.Hit.p) else print("hi") end end)
Equipped is an event, not a property, and you're getting the Spawner in StarterPack, which will never be equipped by the player, as it is replicated into the Backpack object when a new character is created. To do this, a common practice would be to parent the code to the tool, something along the lines of this?
local player = game.Players.LocalPlayer local mouse = player:GetMouse() local noob = game.ReplicatedStorage:WaitForChild("Noob"):Clone() local spawner = script.Parent --the activated event fires when left mouse button is down and the tool is equipped --this eliminates needing to check if it's equipped spawner.Activated:connect(function() local newNoob = noob:Clone() newNoob.Parent = workspace newNoob:MoveTo(mouse.Hit.p) end)
Well, everything looks right, but change 'noob.Parent = game.Workspace'. Remember punctuation.