#why is my scripting saying it expects an string?

1 messages · Page 1 of 1 (latest)

orchid otter
untold nimbusBOT
#

studio** You are now Level 11! **studio

orchid otter
vague sable
#

its probably because it expects a string

#

and what youre sending is not a string

orchid otter
#

i wanna make that

vague sable
#

print typeof(thing)

orchid otter
#

when you click the button the event fires and

#

ok

vague sable
#

and see what it shows you

orchid otter
#

nil?

vague sable
#

its probably nil

orchid otter
#

it is nil.

vague sable
#

ok wait

#

what is this. script.Parent.Parent.Parent.Parent

#

and you are not sending over player

#

you arent sending anything

orchid otter
#

the player

#

i printed and

vague sable
#

then remove o from the arguments.

orchid otter
#

.

vague sable
#

and instead of doing local plr =game.Players:WaitForChild(plr) do
local Player = game.Players:GetPlayerFromCharacter(character)

orchid otter
#

aight

#

i realized that the plr is the fire without the o,

#

i should check before asking

#

but anyways

#

after clicking

#

no errors show up nor the character on workspace but do appear on the player's character

vague sable
#

wait

#

i just realized

#

youre sending a remote

orchid otter
#

yes

vague sable
#

it automatically sends player with it

#

no need to send it as a argument

orchid otter
#

wq

#

oh

vague sable
#

but you need to account for it in the OnSererEvent

#

the first argument will be the player

orchid otter
#

oh

woeful jetty
# orchid otter Detect if event fired.

for ones who want to keep there eyes: |
Server:

game.ReplicatedStorage.addchar.OnServerEvent:Connect(function(o, plr)
  tostring(plr) -- why ?
  local plr = game.Players:WaitForChild(plr) -- plr is already here my guy
  local character = game.ReplicatedStorage.Rig:Clone()
  character.Parent = workspace
  plr.Character = character
end)

Client:

script.Parent.MouseButton1Click:Connect(function()
  game.ReplicatedStorage.addchar:FireServer(script.Parent.Parent.Parent.Parent) -- the parent parent ye
end)
#

Just do:

game.ReplicatedStorage.addchar.OnServerEvent:Connect(function(player: Player)
  local character = game.ReplicatedStorage.Rig:Clone()
  character.Parent = workspace

  player.Character = character
end)
script.Parent.MouseButton1Click:Connect(function()
  game.ReplicatedStorage.addchar:FireServer()
end)
untold nimbusBOT
#

studio** You are now Level 2! **studio

woeful jetty
orchid otter
woeful jetty
orchid otter
#

it literally doesnt send it to workspace

#

there is no error message

woeful jetty
#

add a print to the server thing to check if its executed

orchid otter
#

print(character.Parent)

woeful jetty
#

that anormal

#

hum idk