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

Why does my dab script works in studio, but not in the actual game?

I have created a dab script (for a meme club house.) It works in roblox studio so I decided to show it to the owner of it. It didn't work so I checked the error log. There was nothing.

local Mouse
local d = 0
function onClick()
	if d == 0 then
	d=1
 	local dab = script.Parent.Parent.Humanoid:LoadAnimation(script.Parent.Animation)
	dab:Play()
	wait(1.5)
	print "done"
	d=0
	end
end

function onEquip(a)
	if Mouse == nil then
	Mouse = a
	Mouse.Button1Down:connect(onClick)
	end
end

script.Parent.Equipped:connect(onEquip)

1 answer

On line 17 it would be:

MouseButton1Down:connect(onClick)

If Mouse was a gui button it would be:

local button = script.Parent

button.MouseButton1Down:connect(function()
	-- code here
end)

So it's not Mouse.Button1Down instead it's MouseButton1Down .

I don't think that fixes it but it's worth a try.

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