Title
ServerScript code (which I have no problem with if you need it here)
script.Parent.Touched:Connect(function(part) game.ReplicatedStorage.FirstPlaceEvent:FireAllClients(part) end)
What happened is that when the remote event is triggered which I have no problem with the function being triggered but the wrong thing is that this script is not working properly...
game.ReplicatedStorage.FirstPlaceEvent.OnClientEvent:Connect(function(part) if part.Parent:FindFirstChild("Humanoid") then local player = game.Players[part.Parent.Name] local fpp = script.Parent.FirstPlacePlayer local spp = script.Parent.SecondPlacePlayer local tpp = script.Parent.ThirdPlacePlayer local stats = player.Place local firstPlace = stats.FirstPlace local secondPlace = stats.SecondPlace local thirdPlace = stats.ThirdPlace if fpp.Text == "" and firstPlace == false and secondPlace == false and thirdPlace == false then firstPlace = true fpp.Text = player.Name elseif fpp.Text ~= "" and firstPlace == false and secondPlace == false and thirdPlace == false then secondPlace = true spp.Text = player.Name elseif fpp.Text ~= "" and spp.Text ~= "" then thirdPlace = true tpp.Text = player.Name else print(player.Name.."is neither first place, second or third") end end end)
What happened is that it keeps saying in the output "mudathir2007 is neither first place, second or third
" when I am really first to touch the brick... Please help if you do have a solution. Answers/comments are appreciated. And that's about all that what happened to this script.
Important Info:
Fire Type (FireServer, FireAllClients, FireClient): FireAllClients()
ServerScript Location:workspace.Part
Function Type (Touched, Changed, etc.) Touched
Security Mode: FilteringEnabled
obviously
The main problem could be your Conditional Statements. Starting with this line:
if fpp.Text == "" and firstPlace == false and secondPlace == false and thirdPlace == false then
I'm going to assume stats.firstPlace is a bool value unless stated otherwise The thing with bool values is that you need to do boolValue.Value to address if its true / false
So for example, try doing this instead
firstPlace.Value == false
If they are not BoolValues, I can see what else I can do to help. But I'm thinking the problem is the conditional statements because there is no errors.
Another note to mention, for some reason if you put a variable to equal BoolValue.Value and address it, it will not work (Or at least to my experience)
For example:
variable = BoolValue.Value if variable == true then print"BoolValue is true" end