Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Guiscreen not working when character hits a model?

script.Parent.Touched:Connect(function(hit)
	if hit.Parent.FindFirstChild("Humanoid")
	then
		game.ReplicatedStorage.FoundStar:FireClient(game.Players:GetPlayerFromCharacter(hit.Parent))
	end
end)

I want to make it when it hits the model(a star) it pops up with a Guiscreen telling them they have found the star. My code so far for the guiscreen is:


game.ReplicatedStorage.FoundStar.OnClientEvent:Connect(function()
    game.Players.LocalPlayer.PlayerGui.StarScreen.Enabled = true
end)

I don't know what the problem is ;/

1 answer

✓ Accepted answer

The problem is that models don't have a touched event, so try making a big, transparent, cancollide false part the size of the model, putting it in the model and adding the script u have in that part. It will act as a hitbox.

3 comments

0

I think thats the problem

0

Thank you! I'll try this out now

0

:D

This discussion is preserved as it was. New answers, comments, and votes are closed.