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

I'm trying to make a build UI button not work if its turned off?

Asked by 4 years ago

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!

0
Sorry, I was impatient RobloxGameingStudios 145 — 4y
0
No, my apologies, I didn't notice you had asked another question, it didn't go to my inbox, let me try to fix the problem Ziffixture 6913 — 4y
0
Could you tell me what Value1 looks like? I can also help you either use keystrokes for activating build mode or a GUI if that's what you'd like? Ziffixture 6913 — 4y
0
My goal was to make it where you could go into place mode or non-place mode, where you could use items and do non-build stuff, maybe even have a move and resize tool, value I is placed inside the player RobloxGameingStudios 145 — 4y
View all comments (5 more)
0
value 1 is also a bool value inside the player inside the Players tab. RobloxGameingStudios 145 — 4y
0
hello @feahren have you got a response? Sorry, for the last question, but I just told you what Value 1 is. RobloxGameingStudios 145 — 4y
0
Are there any errormessages? AndriusTheGreat 140 — 4y
0
No, I dont believe so. Nope. RobloxGameingStudios 145 — 4y
0
HELLo anybody gonna reaspond RobloxGameingStudios 145 — 4y

Answer this question