Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a normal Script line works on LocalScript?

Hello, im editing a LocalScript, i made a line that only work for normal scripts and i dont know how to edit it to make it work. can someone help me with this?

Line i want to make it work in a LocalScript

script.Parent.Parent.Parent.Model.Eyes_MeshPart.eye_Decal.Texture = "rbxassetid://983391704"

The LocalScript

local mouse = game.Players.LocalPlayer:GetMouse()

mouse.KeyUp:connect(function (key)
    key = string.lower(key)
        if key == "a" then
                print("a up")
				script.Parent.Parent.Parent.Model.Eyes_MeshPart.eye_Decal.Texture = "rbxassetid://983391704"
                if d == false then
                m.DesiredAngle = 0
                        n.DesiredAngle = m.DesiredAngle
                end
        elseif key == "d" then
                print("d up")
				script.Parent.Parent.Parent.Model.Eyes_MeshPart.eye_Decal.Texture = "rbxassetid://983394022"
                if a == false then
                m.DesiredAngle = 0
                        n.DesiredAngle = m.DesiredAngle
end
        end
        a = false
        d = false
end)

2 comments

0

Setting a texture can be used with both Server Scripts and Local Scripts.

0

How can i edit it? i really dont know why is not working

1 answer

If it works in a script, you could fire a RemoteEvent to use that line of code in a script.

1 comment

0

I tested it in a normal script and dont work, can you show me how to edit it in the LocalScript?

This discussion is preserved as it was. New answers, comments, and votes are closed.