Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why doesn't it work on a client server?

Asked by 8 years ago

** So this code is suppose to make a gooey right next to your mouse saying the name of the part** . the thing is if you test it in studio mode it works perfectly fine! When you test in client mode nothing works. Not a single thing happens when you even hover over the part or click it.

script.Parent.ClickDetector.MouseHoverEnter:connect(function()
    local Mouse = game.Players.LocalPlayer:GetMouse()
    local Gui = Instance.new("ScreenGui")
    Gui.Parent = game.Players.LocalPlayer.PlayerGui
    Gui.Name = "ObjectVar"
    local text = Instance.new("TextLabel")
    text.Parent = Gui
    text.Text = script.Parent.Name
    text.Size = UDim2.new(0,200,0,30)
    text.BorderColor3 = Color3.new(0,0,0)
    text.BorderSizePixel = 1
    text.TextColor3 = Color3.new(255,255,255)
    text.TextStrokeColor3 = Color3.new(0,0,0)
    text.TextStrokeTransparency = 0
    script.Parent.ClickDetector.MouseClick:connect(function()
        script.Parent:Destroy()
        game.Players.LocalPlayer.PlayerGui.ObjectVar:Destroy()
    end)

the part right here makes it when the mouse is not hovering over the part the Gooey is deleted. I'll put it here so you have the full script No errors in output

    repeat text.Position = UDim2.new(0,Mouse.X,0,Mouse.Y) wait() until
    Mouse.X > 500 or Mouse.Y > 600  ---  this part/ part of code Doesn't work and its basically useless :D---
    script.Parent.ClickDetector.MouseHoverLeave:connect(function()
        game.Players.LocalPlayer.PlayerGui.ObjectVar:Destroy()
    end)
end)
0
Is this in a local script located in a local environment? BlackJPI 2658 — 8y
0
no bradleyawsome 10 — 8y
0
I fixed nvm bradleyawsome 10 — 8y

Answer this question