Live Roblox Scripting Tutorials Part 3 - First Person Shooters
In this tutorial, we learn how to make a class system, as well as how to lock the camera to first person for an FPShooter.
Camera Reset on Death Script:
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
char.Humanoid.Died:connect(function()
player.CameraMode = Enum.CameraMode.Classic
end)
end)
end)
Class Changer Script:
local event = game:GetService("ReplicatedStorage").ChangeClass
event.OnServerEvent:connect(function(player, class)
local class = game:GetService("ServerStorage"):FindFirstChild(class)
local guns = class:GetChildren()
for _, gun in ipairs(guns) do
gun:Clone().Parent = player.Backpack
end
player.CameraMode = Enum.CameraMode.LockFirstPerson
end)
LocalScript in the Buttons:
local event = game:GetService("ReplicatedStorage").ChangeClass
script.Parent.MouseButton1Down:connect(function()
event:FireServer(script.Parent.Name)
script.Parent.Parent:Destroy()
end)
Be sure to follow me on Twitter after subscribing!
https://twitter.com/Rrrrry123
Also, follow me on Twitch for some live streams!
http://www.twitch.tv/Rrrrry123
Other Videos By RyGuyGaming
Other Statistics
Roblox Statistics For RyGuyGaming
At present, RyGuyGaming has 459,946 views spread across 106 videos for Roblox, and roughly a days worth of Roblox videos were uploaded to his channel. This makes up 17.76% of the content that RyGuyGaming has uploaded to YouTube.