Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

String Value Connecting to a Random Pet Mod that is already fired in a local script?

Asked by 3 years ago
Edited 3 years ago

Hey Devs,

I have a local script that fires a Random Pet Module and ONLY Prints the pets name

when I go to fire a remote event after to have it give a string value to the player they are different its a different value from the printed pet name…

pretty sure cause I’m calling on the random pet module to make the string as well

but wondering if possible to call from the original chooseRandomPet()…

local petModule = require(game.ReplicatedStorage:WaitForChild("PetModule"))

local repStorage = game:GetService("ReplicatedStorage") local pet = petModule.chooseRandomPet() local player = game:GetService("Players").LocalPlayer

local petVal = Instance.new("StringValue")

local event = Instance.new("RemoteEvent") event.Name = "PetRemote" event.Parent = game:GetService("ReplicatedStorage")

event.OnServerEvent:Connect(function(player, petName)
petVal.Name = pet.Name petVal.Parent = player.PetInventory

end)```

0
Code? mixgingengerina10 223 — 3y
0
this is the current code, can you help please? @mixgingengerina10 CrillicD 0 — 3y

Answer this question