Script works when solo play but not on team test/in game

Hello, im a novice scripter and im trying to create a image button that changes to the image of the faction to indicate that a flag was captured by that faction, the script works in solo only as the title says, but not on team test for some unknown reason
the following server script is the main script that i made, however what i have realise is that it doesnt even print that the player captured it, the server script is in serverscriptservice
note: im also new to dev forum and i have no idea how to close this post when i find the answer

ProximityPrompt.Triggered:Connect(function(plr)
	print("player captured")
	if plr.Character.Humanoid.Health ~= 0 then
		if NeutralizedV.Value == false then

			if plr.Team == Teams.Kiessa then
				local thumbnail = Owners.Kiessa
				print("kiessa captured")
				Values.Owner.Value = "Kiessa"
				changecolor:FireAllClients("Kiessa")
				print("sent remote event to changecolor")
				event:FireAllClients(thumbnail)
			elseif plr.Team == Teams.WhiteSun then
				local thumbnail = Owners.WhiteSun
				Values.Owner.Value = "Order of the White Sun"
				event:FireAllClients(thumbnail)
				print("sent")
			else 
				print("error team not found")

			end
		else
			print("value is true")
		end
	else
		print("player health is 0")
	end

dont mind the changecolor remote event, its for another part of the script which i couldn’t even get it to work (also gui)

12 Likes

One question:

  • How did you locate the proximity prompt?

You can click solution on the post and it will close after 14 days when you solve it.

4 Likes

Good quest whare like “Local PmoxicPromb = Script.Parent.PromixPromb”??

5 Likes
local Capture = game.Workspace.CaptureSystem.Capturables.Capture.Capture
local ProximityPrompt = Capture.ProximityPrompt

its inside the workspace inside a few folders,inside a model and inside a mesh

4 Likes

i didn’t really send the full script, i can if you need me to but its working fine in solo test, i have no clue why its not working

4 Likes

Mm i maybe now why, its maybe you have local Humanoid and Character??

4 Likes

Okay, did you make sure there’s only one proximity prompt and not duplicates? Also, what does this mean?

How is it working fine only in the solo test?

4 Likes

image
on “play” and “play here” its working fine, but
image
on “start” which starts the server, or the team test, it does not work

4 Likes

@SubtotalAnt8185 I maybe now i have another problem in hare Problem with Points get in from Blocks In solo test But if i test in 2 players the have problem

5 Likes

Wait you can choice 2 player and more… and start

5 Likes

no local, its a server script, it sends data of the thumbnail to the local script on the imagebutton which only works in solo

5 Likes

That’s weird, it doesn’t look like it should have problems. Did you check server for errors?

I’ll respond to that one.

4 Likes

also there are no duplicates, there is only 1

3 Likes

yep but its buggy, i have scripts for players and it doesnt work in that, thats why i dont bother using that

3 Likes

yeah, no errors, it doesnt even print that the player triggered it
but it does print it in solo test

3 Likes

That’s weird. Does it trigger in a local script?

3 Likes

i haven’t tested if it can triggers in a local script
but the server script is the one that listen to it, i will try to write a small test on local rn

3 Likes

i just made a simple local script that prints when triggered, it worked in solo as always, does not work in team play, and no errors in the output

4 Likes

That’s very weird. Try just adding a print statement in the script itself. Does that work?

4 Likes

Yes, It printed it
image

3 Likes