Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game.Players.LocalPlayer
- local mouse = plr:GetMouse()
- local cas = game:GetService("ContextActionService")
- local multiplyfactor = 0.1
- function click(actionName, inputState, inputObject, part)
- if mouse and mouse.Target and mouse.Target:GetTags()[1] == "ScriptedPart" then
- if inputState == Enum.UserInputState.Begin then
- local part = mouse.Target
- local points = math.random() * multiplyfactor
- local rdmSize = Vector3.one * points
- print(rdmSize)
- print(points)
- part.Size += rdmSize
- part.Position = part.Position + Vector3.new(0,rdmSize.Y/2,0)
- part.Highlight.FillColor = BrickColor.random().Color
- part.Highlight.OutlineColor = BrickColor.random().Color
- local increment = math.floor(points)
- if increment <= 0 then
- increment += 1
- end
- game.ReplicatedStorage.IncrementPoints:FireServer(increment)
- end
- end
- end
- game:GetService("RunService").RenderStepped:Connect(function()
- if mouse and mouse.Target and mouse.Target:GetTags()[1] == "ScriptedPart" then
- if not mouse.Target:FindFirstChild("Highlight") then
- local higlight = Instance.new("Highlight",mouse.Target)
- higlight.FillColor = BrickColor.random().Color
- higlight.OutlineColor = BrickColor.random().Color
- end
- cas:BindAction("click",click,false,Enum.UserInputType.MouseButton1)
- else
- for i,v in workspace:GetChildren() do
- if v:GetTags()[1] == "ScriptedPart" then
- for index,highlight in v:GetChildren() do
- if highlight:IsA("Highlight") then
- highlight:Destroy()
- end
- end
- end
- end
- cas:UnbindAction("click")
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement