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

How to i make this script begin in MouseButton1Click?

Asked by 5 years ago
Edited 5 years ago

script.Parent.MouseButton1Click:connect (function ()

playername = script.Parent.Parent.Parent.Parent.Parent.Parent.Name

player = Workspace:FindFirstChild(playername)

if player.player ~= nil then

local player.player = script.Parent

local humanoid = Player.Player:WaitForChild("Humanoid")

-- Create the Accessory.

local clockworksShades = Instance.new("Accessory")

clockworksShades.Name = "ClockworksShades"

local handle = Instance.new("Part")

handle.Name = "Handle"

handle.Size = Vector3.new(1,1.6,1)

handle.Parent = clockworksShades

local faceFrontAttachment = Instance.new("Attachment")

faceFrontAttachment.Name = "FaceFrontAttachment"

faceFrontAttachment.Position = Vector3.new(0,-0.24,-0.45)

faceFrontAttachment.Parent = handle

local mesh = Instance.new("SpecialMesh")

mesh.Name = "Mesh"

mesh.Scale = Vector3.new(1,1.3,1)

mesh.MeshId = "rbxassetid://1577360"

mesh.TextureId = "rbxassetid://1577349"

mesh.Parent = handle

-- Attach the Accessory to the humanoid.

humanoid:AddAccessory(clockworksShades)

end

end)

0
You first need to tell us if it's a script inside a gui, if it's local or not and if it's not in a gui where is it. Echtic 128 — 5y
0
It's not a local script, and it's a TextButton den4ik137 -5 — 5y
0
You have loads of syntax errors in your code which will prevent it to run. The code will run in your event in theory, however, the code will not compile. pidgey 548 — 5y
0
And it's inside screengui-frame-Textbutton den4ik137 -5 — 5y
0
i need a fix to this script, please. den4ik137 -5 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Change (""…playername…"") - (playername). You don't need "" and ... if you're not adding anything inside the "".

change all "playerModel" to "player". "player" is already the model.

0
again error(got .) in 7 den4ik137 -5 — 5y
0
what to do? den4ik137 -5 — 5y
0
I edit the script, check it den4ik137 -5 — 5y
Ad

Answer this question