If statement getting the wrong string value

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    Creating an if statement that checks the playerplatform string value in the player

  2. What is the issue? Include screenshots / videos if possible!
    string bug - YouTube

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Nothing yet

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

Local Script

game.ReplicatedStorage.RemoteEvents.satdown.OnClientEvent:Connect(function(seat)
	print("player sat down")
	print(game.Players.LocalPlayer.PlayerPlatform.Value)
	if game.Players.LocalPlayer.PlayerPlatform.Value == "PC" or "Console" then
		print(game.Players.LocalPlayer.PlayerPlatform.Value)	
		if seat.Occupant ~= nil then
			print("pc or console")
			local plr = game.Players.LocalPlayer
			local Char = seat.Occupant.Parent
			plr.IsStunned.Value = true
			uis.InputBegan:Connect(function(input)
				if input.KeyCode == Enum.KeyCode.Space or input.KeyCode == Enum.KeyCode.ButtonA then
					plr.IsStunned.Value = false
				end
			end)
		end
	elseif game.Players.LocalPlayer.PlayerPlatform.Value == "Mobile" then
		if seat.Occupant ~= nil then
			print("mobile")
			local plr = game.Players.LocalPlayer
			local gui = plr.PlayerGui.BoatGui
			gui.TextButton.Position = UDim2.new(0.649, 0,0.914, 0)
			local Char = seat.Occupant.Parent
			plr.IsStunned.Value = true
			gui.TextButton.Activated:Connect(function()
				gui.TextButton.Position = UDim2.new(2, 0,0.914, 0)
			end)
		end
	end
end)

Script

seat:GetPropertyChangedSignal("Occupant"):Connect(function()
	if seat.Occupant ~= nil then
		game.ReplicatedStorage.RemoteEvents.satdown:FireClient(game.Players:GetPlayerFromCharacter(seat.Occupant.Parent),seat)
	end
end)
1 Like

if game.Players.LocalPlayer.PlayerPlatform.Value == "PC" or game.Players.LocalPlayer.PlayerPlatform.Value == "Console" then

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.