#help plesse
13 messages · Page 1 of 1 (latest)
thank you
what is the goal of the script
@pseudo pawn
a part?
do both not work
or only 1
alright
lemme see....
There are a few issues
in the first block of code, the MouseHoverEnter and MouseHoverLeave events are connected to the wrong functions. the MouseHoverEnter event should be connected to the function that fires the enter event, and the MouseHoverLeave event should be connected to the function that fires the leave event. currently, both events are connected to the function that fires the enter event.
in the second block of code, the OnClientEvent events for both the hoverleave and hoverenter events are connected to the same function. this means that only the function for the hoverleave event will be called, regardless of which event is fired.
local clickdec = part.clickdec
local outline = part.outline
local tweenserv = game:GetService("TweenService")
local info = TweenInfo.new(0.25, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
local hovering = false
clickdec.MouseHoverEnter:Connect(function(plr)
game.ReplicatedStorage.hoverenter:FireClient(plr)
print("enter")
end)
clickdec.MouseHoverLeave:Connect(function(plr)
game.ReplicatedStorage.hoverleave:FireClient(plr)
print("leave")
end)
game.ReplicatedStorage.hoverenter.OnClientEvent:Connect(function()
print("client")
hovering = true
local entergoal = {OutlineTransparency = 0}
local entertween = tweenserv:Create(outline,info,entergoal)
entertween:Play()
end)
game.ReplicatedStorage.hoverleave.OnClientEvent:Connect(function()
hovering = false
local leavegoal = {OutlineTransparency = 1}
local leavetween = tweenserv:Create(outline,info,leavegoal)
leavetween:Play()
print("client")
end)
see if this works
hopefully