This is my invis card code. but how do i put it in only one class in the game. i dont want everyone to be able use this card.
fill this file with your verse-script
some of these are not needed, but too many is better than not enough
#Bazoo Studios LLC
#http://www.BazooStudios.com for more!
using {/Fortnite.com/Devices}
using {/Fortnite.com/UI}
using {/Fortnite.com/Game}
using {/Fortnite.com/Characters}
using {/Fortnite.com/Playspaces}
using {/Verse.org/Simulation}
using {/Verse.org/Random}
using {/UnrealEngine.com/Temporary/Diagnostics}
using {/UnrealEngine.com/Temporary/UI}
using {/UnrealEngine.com/Temporary/SpatialMath}
Define a class named InvisibleBehavior that inherits from the creative_device class.
InvisibleBehavior := class(creative_device):
# BELOW IS CARD INVIS STUFF ----------
# Declare a conditional_button_device named CardDetector as an editable attribute.
@editable
CardDetector:conditional_button_device = conditional_button_device{}
@editable
PlayerClass:class_designer_device = class_designer_device{}
# Define an overridden OnBegin method that is called when the game starts.
OnBegin<override>()<suspends>:void=
spawn:
# Call the CheckForCard method when the game begins.
CheckForCard()
# Define a method to check if a card is being held by any player.
CheckForCard()<suspends>:void=
loop:
# Pause for 0.5 seconds.
Sleep(0.5)
# Get all players in the playspace.
AllPlayers:=GetPlayspace().GetPlayers()
# Iterate through each player.
for(Player:AllPlayers):
# Check if the player is an agent.
if(IsAgent:agent = agent[Player]):
# Check if the CardDetector is holding an item for the agent.
if(CardDetector.IsHoldingItem[IsAgent]): # decide inside brackets []
# If holding a card, hide the player.
HidePlayer(IsAgent)
else:
# If not holding a card, show the player.
ShowPlayer(IsAgent)
# Define a method to show a player by displaying their FortCharacter.
ShowPlayer(Agent:agent):void=
if(FC:=Agent.GetFortCharacter[]):
FC.Show() # Show the FortCharacter.
# Define a method to hide a player by hiding their FortCharacter.
HidePlayer(Agent:agent)<suspends>:void=
if(FC:=Agent.GetFortCharacter[]):
FC.Hide() # Hide the FortCharacter.
Preformatted text