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

Can't return a :Connect() pcall function?

Asked by 6 years ago
Edited 6 years ago

Edit, I got the Pcall working, but the function won't end after it doesn't get an error.

if success then
return
end
while success ~= true then
id = id-1
p.ShirtTemplate = "rbxassetid://"..id
wait(0.5)
end

Original Question: The problem with this is that it doesn't end the function when it loads a shirt successfully. I have a script that checks for Pcall at a connect() function. I can't seem to figure out how to get the pcall to work.

game.ReplicatedStorage.ClothingGUI.OnServerEvent:Connect(local success,message = pcall(function(dp,p,et,ID)

In this, I get an error on local, and =. Then I tried changing it to this:

game.ReplicatedStorage.ClothingGUI.OnServerEvent:Connect(function(dp,p,et,ID)local success,message = pcall()

and when I called for success, it said there was no function attached to it, where would I put the pcall here?

1 answer

Log in to vote
0
Answered by 6 years ago

You need to set success to true somewhere.

Ad

Answer this question