So, I made a tool with a little SurfaceGui on, and it just doesn't want to work, I first of all know for a fact that the box highlights grey if a player hovers over it as I didn't change any properties, but then i set up a little script, which warns "BUTTON CLICKED!" if the button is clicked.

Here is the full code:

--[[
  ______  _____ _____  
 |  ____|/ ____|  __ \ 
 | |__  | (___ | |__) |
 |  __|  \___ \|  ___/ 
 | |____ ____) | |     
 |______|_____/|_|     
                                              
--]]

--// Variables \\--

local OPad = script.Parent.Parent
local Workspace = game:GetService("Workspace")
local StarterPack = game:GetService("StarterPack")
local TweenService = game:GetService("TweenService")
local ReplicatedStorage = game.ReplicatedStorage

local CurrentCamera = Workspace.CurrentCamera

local AnimatedOnce = false

--// Scripts \\--

OPad.Equipped:Connect(function(mouse)
    --// Tool Equipped \\--
	warn("OPad equipped.")
	--// Player Variables \\--
	local player = game.Players.LocalPlayer
	--// WalkSpeed Nought \\--
	player.Character:FindFirstChildWhichIsA("Humanoid").WalkSpeed = 0
	--// Wait \\--
	wait(1)
	--// Freeze Player \\--
	repeat wait() until player.Character
	local char = player.Character
	local head = char:WaitForChild("Head")
	head.Anchored = true
	local uppertorso = char:WaitForChild("UpperTorso")
	uppertorso.Anchored = true
	local rightupperleg = char:WaitForChild("RightUpperLeg")
	rightupperleg.Anchored = true
	local rightlowerleg = char:WaitForChild("RightLowerLeg")
	rightlowerleg.Anchored = true
	local rightfoot = char:WaitForChild("RightFoot")
	rightfoot.Anchored = true
	local lowertorso = char:WaitForChild("LowerTorso")
	lowertorso.Anchored = true
	local leftupperleg = char:WaitForChild("LeftUpperLeg")
	leftupperleg.Anchored = true
	local leftupperarm = char:WaitForChild("LeftUpperArm")
	leftupperarm.Anchored = true
	local leftlowerleg = char:WaitForChild("LeftLowerLeg")
	leftlowerleg.Anchored = true
	local leftlowerarm = char:WaitForChild("LeftLowerArm")
	leftlowerarm.Anchored = true
	local lefthand = char:WaitForChild("LeftHand")
	lefthand.Anchored = true
	local leftfoot = char:WaitForChild("LeftFoot")
	leftfoot.Anchored = true
	local humanoidrootpart = char:WaitForChild("HumanoidRootPart")
	humanoidrootpart.Anchored = true	
	--// Tween Camera \\--
    CurrentCamera.CameraType = Enum.CameraType.Scriptable
    local TI = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.In, 1)
    local Goal = {CFrame = player.Character.OPad.Handle.TweenCamera.CFrame}
    local Animation = TweenService:Create(CurrentCamera, TI, Goal)
	Animation:Play()
	wait(1.99)
	Animation:Cancel()
end)

OPad.Unequipped:Connect(function(player)
	--// Tool Unequipped \\--
	warn("OPad Unequipped.")
	--// UnfreezePlayer \\--
	local player = game.Players.LocalPlayer
	CurrentCamera.CameraType = Enum.CameraType.Custom
	--// WalkSpeed Nought \\--
	player.Character:FindFirstChildWhichIsA("Humanoid").WalkSpeed = 16
	--// Unfreeze Player \\--
	repeat wait() until player.Character
	local char = player.Character
	local head = char:WaitForChild("Head")
	head.Anchored = false
	local uppertorso = char:WaitForChild("UpperTorso")
	uppertorso.Anchored = false
	local rightupperleg = char:WaitForChild("RightUpperLeg")
	rightupperleg.Anchored = false
	local rightlowerleg = char:WaitForChild("RightLowerLeg")
	rightlowerleg.Anchored = false
	local rightfoot = char:WaitForChild("RightFoot")
	rightfoot.Anchored = false
	local lowertorso = char:WaitForChild("LowerTorso")
	lowertorso.Anchored = false
	local leftupperleg = char:WaitForChild("LeftUpperLeg")
	leftupperleg.Anchored = false
	local leftupperarm = char:WaitForChild("LeftUpperArm")
	leftupperarm.Anchored = false
	local leftlowerleg = char:WaitForChild("LeftLowerLeg")
	leftlowerleg.Anchored = false
	local leftlowerarm = char:WaitForChild("LeftLowerArm")
	leftlowerarm.Anchored = false
	local lefthand = char:WaitForChild("LeftHand")
	lefthand.Anchored = false
	local leftfoot = char:WaitForChild("LeftFoot")
	leftfoot.Anchored = false
	local humanoidrootpart = char:WaitForChild("HumanoidRootPart")
	humanoidrootpart.Anchored = false
end)

--

Here is a Gyazo example of the issue:

[https://gyazo.com/681e948314ac409a52533ce5ea2970eb]

Any help will be appreciated!! I know it could've been written better, just in a bit of hurry, :D

3 comments

0

Could you show the script of clicking the SufaceGui?

0

Could you show the script of clicking the SufaceGui?

0

The entire model of the player moves only if the HumanoidRootPart moves, so you can clear up tons of lines by just removing all of the anchoring of body parts.