I'm trying to do a 2x XP thing, But I cant use MarketPlaceService because I always get an error when I try to use it so I started using GamePassService but now I cant get the mouse of the player... The reason I need the mouse is because of the keybind so I'm kinda stuck? can anyone help me out??
This is what I'm working with:
local MP = game:GetService("GamePassService") local mouse = Player:GetMouse() mouse.KeyDown:Connect(function(key) local Train = math.random(1,3) if key == "t" then if db == false then db = true --your code
If you need communication between server and client, you would use RemoteEvent
or RemoteFunction
.
Also, using the mouse for keybind is deprecated. It's recommended to use UserInputService
instead.
userinput = game:GetService("UserInputService") function keybind(keypressed, gameProcessedEvent) if keypressed.KeyCode == Enum.KeyCode.T then print("T was pressed") --etc end end userinput.InputBegan:connect(keybind)
Like mouse keybinds
this script has to be a local script.