Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Player = game.Players.LocalPlayer
- local Mouse = Player:GetMouse()
- local Remote = game.ReplicatedStorage["ReplicatedStorage_CLOUD"].UnitControls.PlaceUnit
- local Triggerd = false
- local Trigger = 0
- local UIS = game:GetService("UserInputService")
- local GuiService = game:GetService("GuiService")
- function placeUnit()
- if script.Parent.Configuration.UnitEditor.Value == true then
- Remote:FireServer(script.Parent.Configuration.UnitChoosed.Value, Mouse.hit, script.Parent.Configuration.UnitOrientation.Value, script.Parent.Configuration.UnitPlaceable.Value)
- script.Parent.Configuration.UnitEditor.Value = false
- end
- end
- Mouse.Button1Down:Connect(function()
- if UIS.TouchEnabled and not UIS.KeyboardEnabled and not UIS.MouseEnabled and not UIS.GamepadEnabled and not GuiService:IsTenFootInterface() then
- if Trigger == 1 then
- Trigger = 0
- placeUnit()
- Triggerd = true
- else
- Trigger = 1
- Triggerd = false
- end
- else
- placeUnit()
- end
- end)
- while wait() do
- if Trigger == 1 then
- if Triggerd == false then
- wait(2)
- if Trigger == 1 then
- if Triggerd == false then
- Triggerd = false
- Trigger = 0
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment