Your parameters 'click' and 'click2' are being printed out as numbers because the MouseButton1Down
event, the event you're using, returns two things;
- The x coordinate that your mouse was on, on the gui.
- The y coordinate
The event does not return the player that clicks.. so what you need to do is **make this a localscript ** and index LocalPlayer
from game.Players
.
1 | local plr = game.Players.LocalPlayer |
3 | function opengui(click, click 2 ) |
4 | local kiosk = script.Parent.Parent.Parent.Parent.Parent.ShopGui |
5 | shopgui:Clone().Parent = plr.PlayerGui |
8 | script.Parent.MouseButton 1 Down:connect(opengui) |