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

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

Asked by 8 years ago

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.

01local Mouse
02local d = 0
03function onClick()
04    if d == 0 then
05    d=1
06    local dab = script.Parent.Parent.Humanoid:LoadAnimation(script.Parent.Animation)
07    dab:Play()
08    wait(1.5)
09    print "done"
10    d=0
11    end
12end
13 
14function onEquip(a)
15    if Mouse == nil then
View all 21 lines...

1 answer

Log in to vote
0
Answered by 8 years ago

On line 17 it would be:

1MouseButton1Down:connect(onClick)

If Mouse was a gui button it would be:

1local button = script.Parent
2 
3button.MouseButton1Down:connect(function()
4    -- code here
5end)

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

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

Ad

Answer this question