Home   Search   Register  
GOODBLOX  > General Discussion  > code not working, 11 fps  
 
Display using:  
Previous Thread :: Next Thread 
 Author  Thread: code not working, 11 fps
EnoughPlenty is offline. Last active: 1/25/2024 8:23:18 PM EnoughPlenty
Joined: 29 Apr 2020
Total Posts: 876
 
code not working, 11 fps
Posted: 20 Aug 2020 08:26 AM
local RunServ = game:GetService("RunService")
local Player = game.Players.LocalPlayer
local weaponEvent = game.ReplicatedStorage.equipWeapon
local playerWeapons = game.ServerScriptStorage

RunServ.RenderStepped:Connect(function() -- check every frame
if playerWeapons[Player] then -- check if player in table
-- check every frame the player's weapon
if playerWeapons[Player] == 1 then
weaponEvent:FireServer(playerWeapons[Player])
print(weaponEvent[Player])
elseif playerWeapons[Player] == 2 then
weaponEvent:FireServer(playerWeapons[Player])
print(weaponEvent[Player])
elseif playerWeapons[Player] == 3 then
weaponEvent:FireServer(playerWeapons[Player])
print(weaponEvent[Player])
elseif playerWeapons[Player] == 4 then
weaponEvent:FireServer(playerWeapons[Player])
print(weaponEvent[Player])
elseif playerWeapons[Player] == 5 then
weaponEvent:FireServer(playerWeapons[Player])
print(weaponEvent[Player])
elseif playerWeapons[Player] == 6 then
weaponEvent:FireServer(playerWeapons[Player])
print(weaponEvent[Player])
elseif playerWeapons[Player] == 7 then
weaponEvent:FireServer(playerWeapons[Player])
print(weaponEvent[Player])
elseif playerWeapons[Player] == 8 then
weaponEvent:FireServer(playerWeapons[Player])
print(weaponEvent[Player])
elseif playerWeapons[Player] == 9 then
weaponEvent:FireServer(playerWeapons[Player])
print(weaponEvent[Player])
elseif playerWeapons[Player] == 10 then
weaponEvent:FireServer(playerWeapons[Player])
print(weaponEvent[Player])
end
end
end)
Report Abuse
EnoughPlenty is offline. Last active: 1/25/2024 8:23:18 PM EnoughPlenty
Joined: 29 Apr 2020
Total Posts: 876
 
Re: code not working, 11 fps
Posted: 20 Aug 2020 09:19 AM
in this code, im checking every frame the player's weapon, firing an event and printing it.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
GoodBlox Forum  > GOODBLOX  > General Discussion  > code not working, 11 fps