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

Why wont my script work for kicking players that dont use a VR headset?

Asked by 4 years ago

I took VRService.VREnabled from robloxs site, and put the kick line in it, but it wont print anything or kick me. (it is in a localscript in workspace). Im very new to scripting so sorry.

1local userInputService = game:GetService("UserInputService")
2 
3local isUsingVR = userInputService.VREnabled
4if (isUsingVR) then
5    print("has vr headset :D")
6else
7    print("Turn on your VR headset! This game requires VR")
8    game.Players.Player1:Kick()
9end
0
try to put the local script at StarterGui,StarterPack,StarterCharacterScripts or StarterPlayerScripts BigsChungus 0 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

First Put In in StarterGui Roblox Only Allows LocalScripts In The Player Also Dont Just Go Likegame.Players.Player1:Kick()You Wont Be Able To Kick Anybody Else What I Will Do Islocal userInputService = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer local isUsingVR = userInputService.VREnabled if (isUsingVR) then print("has vr headset :D") else print("Turn on your VR headset! This game requires VR") game.Players[Player.Name]:Kick() end `

Ad

Answer this question