Why wont this work? Im trying to make it so when u build it places a human, and when u click exit build mode u cant build no more? There are no errors.
Local Human placing script
local Value1 = game.Players.LocalPlayer.Build local RemoteEvent = game:GetService("ReplicatedStorage").PlaceHuman local Cursor = game:GetService("Players").LocalPlayer:GetMouse() script.Parent.MouseButton1Click:Connect(function() if Value1.Value == true then Cursor.Button1Down:Connect(function() while true do wait(0.5) if Value1.Value == true then RemoteEvent:FireServer(Cursor.Hit.p) -- Hit is the CFrame, p is the Vector3 translation else print("cannot complete task") end end end) end end)
Server script:
local Number = 1 local RemoteEvent = game:GetService("ReplicatedStorage").PlaceHuman RemoteEvent.OnServerEvent:Connect(function(Player, CursorPos) -- Passed Vector3 local block = game.ReplicatedStorage.Blocks.NPC:Clone() block.Parent = workspace block.Name = Player.Name.. " 's " ..Number + 1 .. "NPC" block:SetPrimaryPartCFrame(CFrame.new(CursorPos)) end)
Please help!