You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear! MouseHoverEnter and MouseHoverEnter to fire when a tool is equiped
-
What is the issue? Include screenshots / videos if possible! MouseHoverEnter and MouseHoverLeave do not fire when a tool is equiped
https://gyazo.com/8e921f2c910b604d7400d50e3476e3e7
- What solutions have you tried so far? Did you look for solutions on the Developer Hub? I have tried disabling the script inside the tool
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
– inside starterpack
local player = game:GetService("Players").LocalPlayer
local Mouse = player:GetMouse()
local TweenService = game:GetService("TweenService")
local RS = game:GetService("ReplicatedStorage")
local Debris = game:GetService("Debris")
local Assets = RS:WaitForChild("Assets")
local Ui = Assets:WaitForChild("UI")
local Sound = Assets:WaitForChild("Sound")
local Remotes = Assets:WaitForChild("Remotes")
local MainModule = require(game.ReplicatedStorage.Main)
for i, v in pairs(workspace:GetDescendants()) do
if v:IsA("ClickDetector") then
v.MouseHoverEnter:Connect(function()
local Highlight = script:WaitForChild("Highlight"):Clone()
Highlight.Parent = v.Parent
Highlight.OutlineTransparency = 1
TweenService:Create(Highlight, TweenInfo.new(0.15, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {OutlineTransparency = 0}):Play()
end)
v.MouseHoverLeave:Connect(function()
v.Parent.Highlight:Destroy()
end)
if v.Parent.Name == "Door" then
v.MouseClick:Connect(function()
MainModule.Door(v.Parent.Parent, Mouse.TargetSurface)
end)
end
if v.Parent.Parent.Name == "NPC" and v.Parent.Parent.Parent == workspace then
v.MouseClick:Connect(function()
Remotes.NPC:FireServer(v.Parent.Name, "Start")
end)
end
end
end
– inside tool
local RS = game:GetService("ReplicatedStorage")
local Debris = game:GetService("Debris")
local Assets = RS:WaitForChild("Assets")
local player = game:GetService("Players").LocalPlayer
local TweenService = game:GetService("TweenService")
local Ui = Assets:WaitForChild("UI")
local Sound = Assets:WaitForChild("Sound")
local Remotes = Assets:WaitForChild("Remotes")
local Items = Assets:WaitForChild("Items")
local Shadows = script.Parent.Shadows
script.Parent.Equipped:Connect(function()
Text = Ui:WaitForChild("ShadowCount"):Clone()
Text.Parent = player.PlayerGui.Hud
Text.Text = "Shadows "..Shadows.Value.."/10"
Shadows.Changed:Connect(function()
Text.Text = "Shadows "..Shadows.Value.."/10"
end)
end)
script.Parent.Unequipped:Connect(function()
Text:Destroy()
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.