RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Fix this script please."
I apologize for the confusion, but it appears there is a mistake in your script. The function `onPromptTriggered` is not defined properly and there is a floating variable `nk`. Here is the corrected version of your script: ```lua local groupId = 1234 -- replace with your group ID local requiredRank = 4 -- replace with your required rank local proximityPrompt = script.Parent.ProximityPrompt function onPromptTriggered(player) local rank = player:GetRankInGroup(groupId) if rank < requiredRank then -- disable the prompt for this player proximityPrompt.Enabled = false else -- enable the prompt for this player proximityPrompt.Enabled = true end end proximityPrompt.Triggered:Connect(onPromptTriggered) ``` In this corrected script, the `onPromptTriggered` function is properly defined and the player's rank in the group is checked whenever the proximity prompt is triggered. If the player's rank is less than the required rank, the proximity prompt is disabled. If the player's rank is equal to or greater than the required rank, the proximity prompt is enabled.