Help with character ability loadout for fighting game

Hello devs,

Recently I’ve been working on a fighting game called strife stadium , i’ve got the base combat sorted but need to get character specific abilities done. Since i’ve got a character shop already done i’ve been able to insert a value in each character to tell the script what the players character is but it claims that the value dosnt exist

Ive checked and it does appear in the character i dont know whats wrong heres my code

local player = game.Players.LocalPlayer
local char = player.Character


if char.StrifeChar.Value == "GOT" then
	script.GOT.TestProjectileOne.Disabled = false
end

if char.StrifeChar.Value == "Alpha" then
	script.GOT.TestProjectileOne.Disabled = true
end

It works by looking for the value in their character then looks in the script for the ability on activates it but its not working pls help.
PS:This is in the starter pack
~Neptune

I’m sorry to hear that but if you want help with that make a topic on the scripting support/help and feedback place

1 Like

If you’re inserting a value inside the Character on the server and then checking for it on the client, then this won’t work as the Character is NetworkOwned by the client and therefore the value added inside the Character won’t replicate to the client.

1 Like

Ahh got it the characters are stored in ServerStorage so i see your
point

How can i do this (I’m not too good at scripting)

Use a remote event to tell the server to change the value

1 Like

Why would I need to change the value it looks for the value to change the players moves in the starter gear
The characters are stored in a folder in ServerStorage btw

Could you add a print in your code before the if statements that says:

print(char.StrifeChar.Value)

then could you tell us what it prints, the problem could be that the StrifeChar.Value is not correct.

1 Like

Aight I’ll try that tomrorow since where I live it’s 10:15 and i can’t really go on

It was claiming the value didn’t exist btw and also my script is a local script

Can I see the script where you add the value to the player’s character?

1 Like

Thing is I put the values in the characters in the storage in ServerStorage so that when they buy them/equip them their character is changed to it so the value is the one in the character model

A couple things. First off, when you refer to the player.Character it will assume you mean the player’s actual character, not anything that is in ServerStorage. On top of that, local scripts can’t see the ServerStorage. The whole difference between local and server scripts is that local scripts can only use anything in the Replicated Storage while Server Scripts can use ServerStorage and ReplicatedStorage. Can I see your script where you add it to ServerStorage maybe I could help you change both of your scripts to make it work.

First of all no script adds it server storage hey are just there and the shop requires them . Second of all the characters by shop are swapped with the players char

Nope giving same response as before here’s the output error
Players.11neptune.Backpack.AttackHandeler:5: attempt to index nil with ‘StrifeChar’

That means that the char variable is the missing thing, try put a wait(3) before you index the character

Thanks man just added it and now it works