#help code not working

1 messages · Page 1 of 1 (latest)

long nimbus
#

so i let my character spawn, and a local script gives the player all the vfx attachments.

then i am using this function to activate the VFX:

activateVFX(plr.Character, "Right Arm", "RightArmVFXfist", "emit", 1.1)

local function activateVFX(character, rigpart, attachment, Type, time)
local rigattachment = character[rigpart][attachment]

    print(rigattachment)

    
    if Type == "beam" then
        game.ReplicatedStorage.RemoteEvents.TriggerBeam:FireAllClients(rigattachment, time or 1)
    elseif Type == "emit" then
        game.ReplicatedStorage.TriggerVFX:FireAllClients(rigattachment, time or 1)
    else -- "enable"
        game.ReplicatedStorage.TriggerVFX2:FireAllClients(rigattachment, time or 1)
    end
    
end

but for some reason it gives me nil every time on rigattachment, anyone know why and how to fix it:

this is what it prints:

RightArmVFXfist is not a valid member of Part "Workspace.kingdesam222.Right Arm"

zealous marsh
zealous marsh
# long nimbus R6
  1. If a LocalScript creates the attachments they only exist on the client not server the server sees:
    RightArmVFXfist is not a valid member of Part "Right Arm"
    because it doesnt exist on the server only the client (lwk)
    verify it with this: print(character["Right Arm"]:GetChildren()) in a server script
#

this will be client sided but try sending the remote event from the client:
RemoteEvent:FireClient(player, rigattachment, time)

#

not server sided

#

@long nimbus

long nimbus
#

Okay so I should fire the event with the attachment

spice sparrowBOT
#

studio** You are now Level 12! **studio

long nimbus
#

Just found out that then all my vfx is local

#

F*CK

#

@zealous marsh