What do you want to achieve?
trying to disable a local script with another local script
What is the issue? Include screenshots / videos if possible!
script just doesnt work
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
i tried using boolvalue, changing local script (the one trying to disable) to a script and using a remote event and using script.disable = true none worked
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Bool = script.Value.Value
Mouse.Button1Down:Connect(function()
if workspace:FindFirstChild("Location") then
workspace.Location:Destroy()
end
local Part = Instance.new("Part")
Part.Shape = "Cylinder"
Part.Size = Vector3.new(0.25, 2, 2)
Part.Anchored = true
Part.CanCollide = false
Part.Orientation = Vector3.new(0,0,-90)
Part.Parent = workspace
Part.Position = Mouse.Hit.p
Part.Name = "Location"
Part.Material = "Plastic"
Part.BrickColor = BrickColor.new("Lime green")
local Character = Player.Character
Character.Humanoid:MoveTo(Mouse.Hit.p)
Part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
Part:Destroy()
end
end)
end)
the script i am trying to disable
local button = script.Parent
local Bool = script.Parent.Bool.Value
local ClickToMoveBool = game.StarterGui.ClickMove.Value
button.MouseButton1Click:Connect(function()
if Bool == true then
button.TextColor3 = Color3.new(1, 0, 0)
Bool = false
ClickToMoveBool.Value = false
elseif Bool == false then
button.TextColor3 = Color3.new(0, 1, 0)
Bool = true
ClickToMoveBool.Value = true
end
end)
the script i am using to disable
oddly enough when checking the explorer the script is disabled but it still works somehow
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local PrintScript = script.Parent:WaitForChild("Print")
Mouse.Button1Down:Connect(function()
print("Player Clicked")
if PrintScript.Enabled == true then
PrintScript.Enabled = false
elseif PrintScript.Enabled == false then
PrintScript.Enabled = true
end
end)
Just check the value when the mouse button is clicked.
Mouse.Button1Down:Connect(function()
if bool.Value == true then
if workspace:FindFirstChild("Location") then
workspace.Location:Destroy()
end
local Part = Instance.new("Part")
Part.Shape = "Cylinder"
Part.Size = Vector3.new(0.25, 2, 2)
Part.Anchored = true
Part.CanCollide = false
Part.Orientation = Vector3.new(0,0,-90)
Part.Parent = workspace
Part.Position = Mouse.Hit.p
Part.Name = "Location"
Part.Material = "Plastic"
Part.BrickColor = BrickColor.new("Lime green")
local Character = Player.Character
Character.Humanoid:MoveTo(Mouse.Hit.p)
Part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
Part:Destroy()
end
end)
end
end)